-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give proxy precedence over history api fallback #16
Conversation
@chooty Hi, thanks for contribution, I planned to add some So please let me add some tests first to confirm that it is working and then I gonna merge this PR. Thanks! |
@chooty I have fixed some issues and added tests including your case, it looks like your issue is already fixed. |
@piotrwitek It works so long as the request to the proxied route doesn't have an accept-header that the fallback middleware will pick up. |
@chooty thanks for elaborating, so I understand that accept header is having impact here, I would like to fix it, can you help me with improving my tests cases? Could you give me hints to have a breaking test I could test is catching your specific scenario? Thanks a lot! |
# Conflicts: # src/jspm-hmr-server.ts
@piotrwitek I've merged 1.0.0-rc5 and updated the test for the combination of fallback and proxy. Please have a look. |
@chooty thanks a lot for helping with this edge case 👍 |
@chooty gonna push a new release with this change later 'rc6' |
Currently the middleware used for the --fallback option is executed before the --proxy middleware. This causes all requests to return index.html, even the ones to the path specified with --proxy-route, in effect making it so --proxy has no effect at all in combination with --fallback.
This change switches the middlewares around so the proxy middleware will proxy any requests to its specified path.