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

Headers object's guard (request-no-CORS) #9

Closed
horo-t opened this issue Jul 2, 2014 · 4 comments
Closed

Headers object's guard (request-no-CORS) #9

horo-t opened this issue Jul 2, 2014 · 4 comments

Comments

@horo-t
Copy link

horo-t commented Jul 2, 2014

I'm implementing Request class in Chromium.
While I'm writing test codes like the following, I noticed a problem.

var baseRequest = new Request('test.html', {headers: {'X-Test': 'test'}});
var request = new Request(baseRequest, {mode: 'no-cors'});
console.log(request.headers.get('X-Test'))  // -> 'test'

This request.headers should not have 'X-Test' header, because the mode is no-cors and 'X-Test' is not a simple header.

http://fetch.spec.whatwg.org/#request-class
The Request(input, init) constructor must run these steps:
...
If r's request's mode is no CORS, run these substeps:

  1. If r's request's method is not a simple method, throw a TypeError.
  2. Set r's Headers object's guard to request-no-CORS.

I think we should remove non simple headers here.

Is my understanding correct?

@annevk
Copy link
Member

annevk commented Jul 3, 2014

I think it would be more consistent if we'd throw for any non-simple header.

@horo-t
Copy link
Author

horo-t commented Jul 3, 2014

Throwing a TypeError sounds reasonable to me too.

@annevk annevk closed this as completed in 540a828 Jul 4, 2014
@annevk
Copy link
Member

annevk commented Jul 4, 2014

@horo-t @wanderview please file new issues through the "file a bug" link at the top of the specification or in https://github.com/slightlyoff/ServiceWorker/issues I don't think anyone is really following issues here. Thanks!

yutakahirano added a commit that referenced this issue Jun 23, 2020
# This is the 1st commit message:

# This is a combination of 23 commits.
# This is the 1st commit message:

Integrate CORP and COEP

This is part of the introduction of COEP
(whatwg/html#5454). The CORP check now takes
COEP into account. Also, responses coming from service workers
are checked.

# This is the commit message #2:

Update fetch.bs

Co-authored-by: Domenic Denicola <d@domenic.me>
# This is the commit message #3:

Update fetch.bs

Co-authored-by: Domenic Denicola <d@domenic.me>
# This is the commit message #4:

fix

# This is the commit message #5:

fix

# This is the commit message #6:

fix

# This is the commit message #7:

fix

# This is the commit message #8:

fix

# This is the commit message #9:

fix

# This is the commit message #10:

fix

# This is the commit message #11:

fix

# This is the commit message #12:

fix

# This is the commit message #13:

fix

# This is the commit message #14:

fix

# This is the commit message #15:

fix

# This is the commit message #16:

fix

# This is the commit message #17:

fix

# This is the commit message #18:

Update fetch.bs

Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
# This is the commit message #19:

Update fetch.bs

Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
# This is the commit message #20:

fix

# This is the commit message #21:

fix

# This is the commit message #22:

fix

# This is the commit message #23:

fix

# This is the commit message #2:

fix
@xgqfrms

This comment has been minimized.

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

3 participants