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

corsMode calculation in the "Processing Model" section is broken #53

Closed
tyoshino opened this issue Aug 23, 2017 · 1 comment
Closed

Comments

@tyoshino
Copy link

/cc @yutakahirano

https://w3c.github.io/beacon/#sec-processing-model

corsMode is declared in one of the substeps in the step 4 but referenced from the step 5. Instead, it should be declared at the top level and modified by the step 4.

I also think the step 5 should be part of the step 4.

headerList should be initialized as an empty header list, not null.

So, it should be:

  1. Let fetchMode be "no-cors".
  2. Let headerList be a new empty header list.
  3. If data is not null:
    • Extract ...
    • If the amount ...
    • If mimeType is not null:
      • If Content-Type/mimeType is not a CORS-safelisted request-header, set fetchMode to "cors".
      • Append Content-Type/mimeType to headerList.
@tyoshino tyoshino changed the title corsMode calculation in Processing Model is broken corsMode calculation in the "Processing Model" section is broken Aug 23, 2017
igrigorik added a commit that referenced this issue Aug 25, 2017
- declare var's before setting them·
- simplify logic flow

Closes #53.
@igrigorik
Copy link
Member

@tyoshino thanks, good suggestions! I opened #54 to address this -- ptal.

igrigorik added a commit that referenced this issue Sep 11, 2017
- Keep no-cors mode if Content-Type is null
- Declare var's before setting them

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

No branches or pull requests

2 participants