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

Pass recursive=false to manual navigation redirect #1638

Merged
merged 3 commits into from
Apr 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5352,8 +5352,20 @@ run these steps:
<li><p>Invoke <a>set <var>request</var>'s referrer policy on redirect</a> on <var>request</var> and
<var>actualResponse</var>. [[!REFERRER]]

<li><p>Let <var>recursive</var> be true.

<li>
<p>If <var>request</var>'s <a for=request>redirect mode</a> is "<code>manual</code>", then:

<ol>
<li><p>Assert: <var>request</var>'a <a for=request>mode</a> is "<code>navigate</code>".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. You can always set it to "manual" and get an opaque response at the moment. Mainly useful in service workers with navigations though.

I suggest we do something like

Let recursive be true if ....; otherwise false.

instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea but if it's manual non-navigation you wouldn't get to this bit as fetch would never process your redirect. Anyway, revised.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, that's good pushback and solid rationale. Why revise?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly because that assert is potentially more confusing than helpful and I wasn't sure about it. Should we keep it or throw it? I could go either way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that it's correct it seems like a good addition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


<li><p>Set <var>recursive</var> to false.
</ol>

<li>
<p>Return the result of running <a>main fetch</a> given <var>fetchParams</var> and true.
<p>Return the result of running <a>main fetch</a> given <var>fetchParams</var> and
<var>recursive</var>.

<p class=note>This has to invoke <a>main fetch</a> to get <var>request</var>'s
<a for=request>response tainting</a> correct.
Expand Down