<blockquote>
<p dir="auto"><strong>I'm use the onBeforeRequest to intercept my request and redirect to my protocol "app",but,when i use the http.request(nodejs) to make a request(a set-cookie will come with the response),let this registerStreamProtocol‘s callback process the response,and then , I'm lose the  set-cookie.’</strong></p>
</blockquote>
<blockquote>
<p dir="auto">How do I get this set-cookie</p>
</blockquote>
<blockquote>
<p dir="auto">electron@9.3.1</p>
</blockquote>
<h3 dir="auto">Preflight Checklist</h3>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>
 v9.0.0
</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>
 macOS 10.15.5
</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>
 5.x.y
</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>

<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="request.on('redirect', (statusCode, method, redirectUrl, responseHeaders) =&gt; {
  console.log(responseHeaders['set-cookie']); // should not be undefined
});"><pre class="notranslate"><span class="pl-s1">request</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'redirect'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">statusCode</span><span class="pl-kos">,</span> <span class="pl-s1">method</span><span class="pl-kos">,</span> <span class="pl-s1">redirectUrl</span><span class="pl-kos">,</span> <span class="pl-s1">responseHeaders</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">responseHeaders</span><span class="pl-kos">[</span><span class="pl-s">'set-cookie'</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// should not be undefined</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Actual Behavior</h3>

<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="request.on('redirect', (statusCode, method, redirectUrl, responseHeaders) =&gt; {
  console.log(responseHeaders['set-cookie']); // is undefined no matter what
});"><pre class="notranslate"><span class="pl-s1">request</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'redirect'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">statusCode</span><span class="pl-kos">,</span> <span class="pl-s1">method</span><span class="pl-kos">,</span> <span class="pl-s1">redirectUrl</span><span class="pl-kos">,</span> <span class="pl-s1">responseHeaders</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">responseHeaders</span><span class="pl-kos">[</span><span class="pl-s">'set-cookie'</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// is undefined no matter what</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">To Reproduce</h3>

<p dir="auto">I've put together a small proof of concept using the electron-quick-start demo found <a href="https://github.com/walmat/electron-quick-start">here</a>.</p>
<p dir="auto">To run the example:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="git clone https://github.com/walmat/electron-quick-start.git &amp;&amp; yarn &amp;&amp; yarn start"><pre class="notranslate">git clone https://github.com/walmat/electron-quick-start.git <span class="pl-k">&amp;&amp;</span> yarn <span class="pl-k">&amp;&amp;</span> yarn start</pre></div>



<h3 dir="auto">Screenshots</h3>

<h3 dir="auto">Additional Information</h3>