- Operating System: Mac OSX High Sierra
- Node Version: 10.16.0
- NPM Version: 6.9.0
- webpack Version: 4.36.1
- webpack-dev-server Version: 3.7.2
- Browser: Chrome 74.0.3729.169
Code
// webpack.config.js
...
config.devServer.proxy = {
'**': {
bypass(request) {
if (request.headers.accept && request.headers.accept.includes('html')) {
console.log('HTML', request.headers, request.url)
return '/index.html';
}
console.log('API', request.headers, request.url)
return false;
},
target: `http://localhost:${apiPort}`
}
};
...
Expected Behavior
non-html requests are proxied to the target url.
Actual Behavior
The proxy middleware sets the request url as null if the bypass function returns a boolean, resulting in a 404 on page load.
For Bugs; How can we reproduce the behavior?
In PR #1696 , the actual behavior is listed as the previously intended behavior. This Issue is only to add a breaking change notice to the 3.3.0 release notes because previous consumers relied on an api which had its functionality changed in a non backwards compatible way.
For Features; What is the motivation and/or use-case for the feature?
Code
Expected Behavior
non-html requests are proxied to the
targeturl.Actual Behavior
The proxy middleware sets the request url as null if the bypass function returns a boolean, resulting in a 404 on page load.
For Bugs; How can we reproduce the behavior?
In PR #1696 , the actual behavior is listed as the previously intended behavior. This Issue is only to add a breaking change notice to the 3.3.0 release notes because previous consumers relied on an api which had its functionality changed in a non backwards compatible way.
For Features; What is the motivation and/or use-case for the feature?