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

Request constructor does not check used flag on null body #55

Closed
wanderview opened this issue May 19, 2015 · 3 comments
Closed

Request constructor does not check used flag on null body #55

wanderview opened this issue May 19, 2015 · 3 comments

Comments

@wanderview
Copy link
Member

Over in yutakahirano/fetch-with-streams#37 (comment) @yutakahirano noticed that this code may not do what is expected:

var req = new Request(url, {body: 'hello'});
fetch(req);
fetch(req);

I think we would expect the second fetch() to reject on a drained Request, but it won't. The first fetch() sets the request's used flag to true and its body to null. The second fetch(), however, only looks at the used flag if the body is not null.

What do you think @annevk?

@annevk
Copy link
Member

annevk commented Jun 9, 2015

Oh yes that is bad. I'm starting to think we should do #61 while we still can.

@annevk
Copy link
Member

annevk commented Jul 16, 2015

Can we simply move the used flag check out of the non-null body clause? Would that miss anything? Over in #61 we talked about introducing an obsolete flag, but I don't really think that's necessary here.

@annevk annevk closed this as completed in 9c33150 Jul 16, 2015
@wanderview
Copy link
Member Author

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