Skip to content
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

Response improvements #317

Closed
3 tasks done
ebidel opened this issue Aug 17, 2017 · 7 comments
Closed
3 tasks done

Response improvements #317

ebidel opened this issue Aug 17, 2017 · 7 comments

Comments

@ebidel
Copy link
Contributor

ebidel commented Aug 17, 2017

For further parity with https://developer.mozilla.org/en-US/docs/Web/API/Response, these would be useful to add

  • Response.statusText
  • Response.redirected
  • Request.type
@ebidel ebidel added the feature label Aug 17, 2017
@aslushnikov
Copy link
Contributor

We gave up on aligning with fetch api: #106

So we'd rather not add anything to the api unless there's a real-world user scenario to prove the necessity.

@ebidel
Copy link
Contributor Author

ebidel commented Aug 17, 2017

I filed this because I ended up wanting all 3 when trying out network interception apis for the first time. If I ran into it in < 5min I suspect others will want it to.

use cases:

  • Response.type in particular is pretty handy to know the initiator of a request (xhr, script, parser).
  • statusText is useful b/c people parse out custom messages from server responses. -
  • Response.redirected is just nice to know.

@ebidel
Copy link
Contributor Author

ebidel commented Aug 17, 2017

BTW, we should try to keep features requests open so people can find and subscribe to them more easily. Also helps us prioritize!

@aslushnikov
Copy link
Contributor

Response.type in particular is pretty handy to know the initiator of a request (xhr, script, parser).

That's not what response.type is: https://developer.mozilla.org/en-US/docs/Web/API/Response/type
Do you mean request.type?

The response.redirected is easy to polyfill:

let redirected = 300 <= response.statusCode && response.statusCode <= 399;

statusText is useful b/c people parse out custom messages from server responses.

Ahh, I see. We should plumb this from interception then.

BTW, we should try to keep features requests open so people can find and subscribe to them more easily. Also helps us prioritize!

That's right, however we don't want to be buried under the unmanageable pile of issues. For this reason we aggressively close everything we don't feel like implementing. It's totally fine to comment or reopen to argue :)

@ebidel
Copy link
Contributor Author

ebidel commented Aug 17, 2017

Yep, request.type.

@itaysabato
Copy link

statusText seems like a very basic (and easy) thing to expose. And I need it :)

@aslushnikov
Copy link
Contributor

@itaysabato we don't have status text for the intercepted requests; however, we'll get it for free once a huge on-going refactoring of network layer in chromium completes. No good ETA on this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants