-
Notifications
You must be signed in to change notification settings - Fork 220
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
Changing HTTP Response code does not work #198
Comments
It's possible it's a DevTools issue, but I'll add a test to confirm :-) |
yep, it's broken. reproduced by going to: http://evilwebsite.com/shell.html and typing (async x=>{print((await fetch("")).status)})() changing from 200 to 201 returns 200 |
The value flows from here: tamperchrome/v2/background/src/request.ts Line 89 in 1ad8700
to here: tamperchrome/v2/background/src/request.ts Line 146 in 1ad8700
and ends in https://chromedevtools.github.io/devtools-protocol/tot/Fetch/#method-fulfillRequest weird :) |
Seems like Chrome recognizes the new status code, as it behaves differently when changing it from 200 to 302 (it only allows a |
And it seems like Chrome doesn't look at the status of intercepted requests There's an explicit check for Looking at how the |
my current theory is that the headers come from the |
this test seems to explain how the interception between devtools and the url req factory is done |
so, networkserviceclient is the one that brokers the connection between the url_loader and devtools, it seems. |
and here seems to be where things are overriden. or actually here to be more accurate: |
looking at the behavior of |
So, the two mojo services are: The difference is explained here: // Callback interface for NetworkContext when routing identifiers aren't
// available. Otherwise generally callbacks from the network service go on
// NetworkServiceClient. |
The and the I'm not sure why this is done this way. |
will file a bug with chrome, with a small reproducer, and see if they can investigate |
Dang... this is the one thing that I needed to work to fake/mock backend errors and it doesnt work 😢 |
Hi guys, There's something that I can help you with? This feature seems to be amazing testing. |
it's complicated, it'll probably be easier to remove this feature from Tamper.dev (or restrict it to just the status code that have side effects - so, redirects) |
Hi! First of all, awesome extension 💯 👍
I am however unable to modify the HTTP response code:
The text was updated successfully, but these errors were encountered: