File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -197,9 +197,14 @@ export default (ctx, inject) => {
197
197
198
198
< % if ( options . proxyHeaders ) { % >
199
199
// Proxy SSR request headers headers
200
- axiosOptions . headers . common = ( ctx . req && ctx . req . headers ) ? Object . assign ( { } , ctx . req . headers ) : { }
201
- < % for ( let h of options . proxyHeadersIgnore ) { % > delete axiosOptions . headers . common [ '<%= h %>' ]
202
- < % } % > < % } % >
200
+ if ( process . server && ctx . req && ctx . req . headers ) {
201
+ const reqHeaders = { ...ctx . req . headers }
202
+ for ( let h of < %= serialize ( options . proxyHeadersIgnore ) % > ) {
203
+ delete reqHeaders [ h ]
204
+ }
205
+ axiosOptions. headers . common = { ...reqHeaders , ...axiosOptions . headers . common }
206
+ }
207
+ < % } % >
203
208
204
209
if ( process . server ) {
205
210
// Don't accept brotli encoding because Node can't parse it
You can’t perform that action at this time.
0 commit comments