Altair: Allow overriding of the Origin header (Postman allows this)

Created on 4 Jun 2018  路  8Comments  路  Source: imolorhe/altair

Describe the bug
When attempting to set the Origin header in the Altair app it still ends up being altair://applications

To Reproduce
Steps to reproduce the behavior:

  1. Go to Set Headers
  2. Set Origin to a custom domain.
  3. Save
  4. Send Request
  5. Check dev tools for Origin header that is sent.

Expected behavior
Origin header is set to the custom header when the request is sent.

Desktop (please complete the following information):

  • OS: macOS Sierra Version 10.12.6
  • Altair Version: Version 1.7.2 (1.7.2.838)

Additional context
We do things with the Origin header in production, so being able to manipulate this Header is extremely useful. Postman allowed this with our REST implementations, and switching over to GQL we would like to maintain some of that functionality.

enhancement

All 8 comments

Thanks for reporting this! I'd look into it as soon as I can

@Vinlock This functionality would only be available while using the electron app. It is not possible to set the origin headers in a normal web environment because it is a forbidden header.

@imolorhe , Hey man, the Origin override no longer works for us after upgrading to Version 2.4.4 (2.4.4.5808).
Even I added custom origin in the Set Headers modal, it still sends Origin: altair://-.

Anything changed in code or it is from Electron?
Thanks.

Hey @vcfvct, I just tested it now and the Origin header is being set as expected. The developer tools shows the Origin as altair://- but when I check the origin header on the GraphQL server, it is electron://altair by default and when I set the origin header, it is set appropriately.

You should confirm from the server side. I don't know how to get the developer tools in electron to show the correct thing.

@imolorhe Appreciate the quick reply. Looks like my call failed for other reasons. Basically none of my query works any more. I saw below error in console. Any idea? Shall I open a new issue? Thank you!

main.js:1 Error sending the request TypeError: Cannot read property 'filter' of undefined
    at e.hasInvalidFileVariable (main.js:1)
    at t.project (main.js:1)
    at t._next (main.js:1)
    at t.next (main.js:1)
    at e._subscribe (main.js:1)
    at e._trySubscribe (main.js:1)
    at e.subscribe (main.js:1)
    at e.call (main.js:1)
    at e.subscribe (main.js:1)
    at e.call (main.js:1)

Yes you should open a new issue. Try opening a new window and trying again though.

Try opening a new window and trying again though.

@imolorhe Oh, you the man. For whatever reason, looks like the recent upgrade breaks all my previous tabs. After duplicate them all, everything works fine again. Not sure if it is just me or a common issue but thanks a lot for the suggestion!

Nice. You're the only person that has reported this issue though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XAKEPEHOK picture XAKEPEHOK  路  8Comments

imolorhe picture imolorhe  路  4Comments

benhutton picture benhutton  路  10Comments

bsr203 picture bsr203  路  12Comments

simPod picture simPod  路  5Comments