<p dir="auto">now i know that nodejs can be build into android os and can be work well.<br>
like the url:<br>
<a href="https://github.com/dna2github/dna2oslab">https://github.com/dna2github/dna2oslab</a></p>
<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>9.0.5</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>N/A</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">When making a request through NodeJS using request-promise, I get an output with the following headers.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13423028/87236580-0e47ed80-c3a0-11ea-904b-773541b7ed1d.png"><img width="1288" alt="Screen Shot 2020-07-11 at 5 57 14 PM" src="https://user-images.githubusercontent.com/13423028/87236580-0e47ed80-c3a0-11ea-904b-773541b7ed1d.png" style="max-width: 100%;"></a></p>
<p dir="auto">This is the output that I expect to see, where there are two cookies in "Set-Cookie", the "Access-Control-Allow-Headers" header only contains "Content-Type", and the "Access-Control-Allow-Origin" header is specific.</p>
<h3 dir="auto">Actual Behavior</h3>

<p dir="auto">However, when I run the same exact script within an Electron context, where the same function is called from the frontend, I get different behavior. The following response headers are from when run in an Electron context.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13423028/87236640-739bde80-c3a0-11ea-97c9-de3ba6ed3eff.png"><img width="745" alt="Screen Shot 2020-07-11 at 5 52 46 PM" src="https://user-images.githubusercontent.com/13423028/87236640-739bde80-c3a0-11ea-97c9-de3ba6ed3eff.png" style="max-width: 100%;"></a></p>
<p dir="auto">There are significant discrepancies between the two, and, most importantly, one of the cookies in the 'set-cookie' header is missing, when run from an Electron context. I am unable to find an explanation as to why this is happening. Interestingly enough, when I used Electron's native Net module, I was able to get the correct HTTP response, so I have narrowed it down to some sort of NodeJS issue from within an Electron context.</p>
<p dir="auto"><strong>UPDATE</strong><br>
I have been able to narrow it down even further. It looks like the request is working perfectly within an electron context, <em>until I create a BrowserWindow <em>instance</em></em>. At that point, the response headers start going missing, as in the second picture.</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">Since this is a company project, I am unable to provide source code. However, my question still stands: is there some sort of difference in NodeJS when running natively versus in an electron context, and can that different be detected in an HTTP request?</p>