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

What is the default value of a requests client? #907

Open
bzbarsky opened this issue May 22, 2019 · 4 comments
Open

What is the default value of a requests client? #907

bzbarsky opened this issue May 22, 2019 · 4 comments

Comments

@bzbarsky
Copy link

bzbarsky commented May 22, 2019

Spec at https://fetch.spec.whatwg.org/#concept-request-client says:

A request has an associated client (null or an environment settings object).

There is no "unless stated otherwise" clause, but there is also no indication what the client should be set to when a request is created. I assume it should default to null, but it's not 100% clear.

@bzbarsky
Copy link
Author

@annevk

@annevk
Copy link
Member

annevk commented May 23, 2019

The expectation is that everyone that creates a request sets this field to a value. In a way this might be a duplicate of #186.

@bzbarsky
Copy link
Author

Would it make sense to require this value to create a request at all, then? That is the "create a request" algorithm would take it as input. That would make it a lot easier to catch cases where people are failing to set it, I'd think.

@annevk
Copy link
Member

annevk commented May 23, 2019

Yeah, I hadn't really created such abstractions yet since not everyone adopted Fetch as their infrastructure (e.g., CSS).

We might have enough usage now though to figure out how to refactor various aspects.

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

No branches or pull requests

2 participants