0

const url = 'https://nettle-feather-area.glitch.me/'
const opts = {
    headers: {
        'Content-Type': 'application/json', 
        'authorization': 'asdf',
        'x-custom-header': 'asdf',
    },
    method: 'POST',
    credentials:"include",
    body: JSON.stringify({ message: 'ping' }),
}
fetch(url,opts);

enter image description here

I can see that stackoverflow somehow manages to set origin to null in this request, how does it do that? Would expect origin to be https://stackoverflow.com or as commenters have mentioned maybe stacksnippets.net. Anything but null!

Is it something to do with iframes?

4
  • 1
    Why should it be stackoverflow.com? The snippet is executed on stacksnippets.net Commented Aug 4, 2021 at 9:57
  • yes, it's stacksnippets.net - I wonder if it has something to do with it being in an iframe - because stacksnippets not in an iframe don't do that Commented Aug 4, 2021 at 10:06
  • yeah okay should be stacksnippets.net anything but null!! Commented Aug 4, 2021 at 10:09
  • yep that looks to be it! Commented Aug 4, 2021 at 11:16

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.