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

[Meeting] 2022-12-01 08:00am Pacific time #41

Closed
jasnell opened this issue Nov 30, 2022 · 5 comments
Closed

[Meeting] 2022-12-01 08:00am Pacific time #41

jasnell opened this issue Nov 30, 2022 · 5 comments

Comments

@jasnell
Copy link
Contributor

jasnell commented Nov 30, 2022

Agenda items:

  • Updates on current initiatives
    • fetch spec
    • runtime keys
    • common minimum api
    • async context
  • Socket APIs (jasnell) - Cloudflare is working on a Socket API that is based on ReadableStream/WritableStream. We've noticed some inconsistencies in the way things are implemented across Node.js, Deno, etc.
  • Specifier namespaces (jasnell) - Node.js recently introduced the node:... specifier prefix for built-in modules, Deno just introduced use of the npm:... specifier prefix for npm modules. In Workers, we are starting on Node.js-compatibility using the node:... prefix. Should we standardize on these prefixes? Would the runtime keys help here?
@jasnell jasnell changed the title [Meeting] 2022-11-30 08:00am Pacific time [Meeting] 2022-12-01 08:00am Pacific time Nov 30, 2022
@Ethan-Arrowood
Copy link
Contributor

"Node.js Spec"

Its been discussed previously (before WinterCG was even founded), and now it is making rounds again. Would like to hear people's thoughts on it especially motivations and how it would fit into the WinterCG world (we already have minimum common api proposal).

@ytxmobile98
Copy link

ytxmobile98 commented Dec 1, 2022

I would like to continue a discussion regarding the fetch API.

In fetch we may have a { redirect: 'manual' } option. When this option is set and a redirect is detected, the agent will not follow the actual URL, but will rather stop and let the developer specify how it behaves differently.

In WHATWG spec it says that it needs to return an opaque-redirect filtered response where status code is 0, status text is empty string, and type is opaqueredirect. In addition, in major browser implementations, the URL in the response is the URL that the fetch initially requested, not the actual URL it should follow.

However in Node.js the behavior is different: the status code is 3xx (meaning redirect), and the status text is the HTTP message that matches the redirect code. The type is default.

I also checked Deno and observed similar behavior.

So I would like to have a discussion regarding the details of manual redirects in fetch as we are gradually establishing the WinterCG standard.

I am raising this topic because I am working with service workers at my company, and in those scenarios people may be interested in what the exact redirected URLs are and use them in the workers accordingly. In the browser environment it makes sense not to have everything transparent when it comes to handling redirects, for better security protection. However in the worker environment such protection may make much less sense; instead, service workers may do a variety of different things to handle the redirect.

Prior discussions:

@dom96
Copy link

dom96 commented Dec 1, 2022

For reference, here is what I presented today: https://gist.github.com/dom96/11fa8f568c9ae99a77784d9699f05a24

@Ethan-Arrowood
Copy link
Contributor

To Do:

Add a new property to request options that allows wintercg/fetch to return the relevant information. Something like fetch('//:url', { redirect: 'manual', foobar: true }).

  • Adjust our spec to reflect change

@jasnell
Copy link
Contributor Author

jasnell commented Dec 1, 2022

Meeting recording link: https://us06web.zoom.us/rec/share/l2hIkjKjrEpoiW99BFpkOcrPgk8h7waa4ND5ECbPfZ_BpNHciS5e2NTkRJkAdDod.75-aHKWiklEAkyW0
Passcode: c.#NT97C

@jasnell jasnell closed this as completed Jan 12, 2023
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

4 participants