<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>28343</bug_id>
          
          <creation_ts>2015-03-26 14:33:15 +0000</creation_ts>
          <short_desc>&quot;manual redirect flag&quot;</short_desc>
          <delta_ts>2015-03-27 12:31:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>Fetch</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mike West">mkwst</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>bkelly</cc>
    
    <cc>d</cc>
    
    <cc>jaffathecake</cc>
    
    <cc>jonathan</cc>
    
    <cc>mike</cc>
          
          <qa_contact>sideshowbarker+fetchspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>118957</commentid>
    <comment_count>0</comment_count>
    <who name="Mike West">mkwst</who>
    <bug_when>2015-03-26 14:33:15 +0000</bug_when>
    <thetext>https://fetch.spec.whatwg.org/#concept-request-manual-redirect-flag

[[
manual redirect flag
]]

It would be nice if we had a mechanism of setting this (or anything like it) when calling into `fetch()`. This would give us the ability to mitigate certain risks by ensuring that data meant for one location isn&apos;t accidentally redirected to another.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118958</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-03-26 14:43:25 +0000</bug_when>
    <thetext>Tentative proposal:

  errorOnRedirect = false

as we cannot expose redirects directly which the &quot;manual redirect flag&quot; does (and is needed for internal algorithms such as &quot;navigate&quot;).

When this property is set we&apos;d set the manual redirect flag and reject with a TypeError if a redirect of sorts is returned.

It will also be reflected on Request of course.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118959</commentid>
    <comment_count>2</comment_count>
    <who name="Mike West">mkwst</who>
    <bug_when>2015-03-26 14:49:37 +0000</bug_when>
    <thetext>Sounds fine to me. My only requirement is the ability to assert that a particular request will touch _only_ a specific URL, and will otherwise fail. I&apos;m happy with any mechanism you&apos;re happy with that achieves that result.

[insert questions about service workers here]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118960</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-03-26 14:53:54 +0000</bug_when>
    <thetext>Oh, you want to make such an assertion from a document with a service worker not being able to affect it? Because that would be impossible as far as I can tell.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118961</commentid>
    <comment_count>4</comment_count>
    <who name="Mike West">mkwst</who>
    <bug_when>2015-03-26 15:00:57 +0000</bug_when>
    <thetext>(In reply to Anne from comment #3)
&gt; Oh, you want to make such an assertion from a document with a service worker
&gt; not being able to affect it? Because that would be impossible as far as I
&gt; can tell.

If it wasn&apos;t impossible, yes! I&apos;d love that! :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118976</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-03-27 10:13:12 +0000</bug_when>
    <thetext>Manual redirect flag is now a mode:

https://github.com/whatwg/fetch/commit/83981498175633510878ebf97077ec632ceedc29

My plan is to expose &quot;follow&quot; and &quot;error&quot; to JavaScript and leave &quot;manual&quot; for HTML&apos;s navigate algorithm and any future controlled request context algorithms.

Judging from RequestInit today, it would be something like:

  .redirect = &quot;error&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118979</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-03-27 12:29:42 +0000</bug_when>
    <thetext>*** Bug 26238 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118980</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-03-27 12:31:56 +0000</bug_when>
    <thetext>https://github.com/whatwg/fetch/commit/b6b4f87048020cda6237ca4af02df62d43f99765</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>