-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
proxy.bypass return false does not work #1677
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
Comments
Can you try return |
Anyway PR welcome |
@evilebottnawi I tried I'll try to find some time this weekend to take a look. I might be posting as @jshado1 (my personal account, not a catfish). |
@jsmith-sapient i will look on this in near future, anyway we glad any help |
@jsmith-sapient reproducible test repo works fine, i am use |
@evilebottnawi please see the commit history:
|
@jsmith-sapient thanks, it is very strange because we have tests on this case and tests passed 😕 |
|
@evilebottnawi I think you're talking about this case: it('should pass through a proxy when a bypass function returns null', (done) => {
req.get('/foo.js').expect(200, /Hey/, done);
}); If so, the function does not return null: '/foo': {
bypass(req) {
if (/\.html$/.test(req.path)) {
return '/index.html';
}
},
}, |
@jsmith-sapient we return nothing in this test, i think |
I don't think so. I would expect no return to mean "go ahead, proxy, do your thing". How else would that be signalled? |
@jsmith-sapient in previous versions all works fine, right? |
I haven't used |
I'm having trouble finding where this is in the source code. Could you point me in the right direction? |
/cc @hiroppy need fix this problem next 👍 Should be not difficult |
Code
does not work:
does work:
Expected Behaviour
Based on the vague explanation in the docs
I expect
return false
to skip the proxyActual Behaviour
return false
does nothing.For Bugs; How can we reproduce the behaviour?
Minimal example: https://github.com/jsmith-sapient/local-api-mocker
The text was updated successfully, but these errors were encountered: