graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

X-Forwarded-For header missing in remote schema request

Open eizemazal opened this issue 3 years ago • 11 comments

Hi, I am using Python Graphene-based remote schema behind Hasura to implement business logic.

I need to check clients' IP in my backend, and expect Hasura to provide X-Forwarded-For header. But the header is not sent over.

I am not printing all the headers here, but I have X-Forwarded-User-Agent (my client's browser UA) and X-Forwarded-Host (i.e. address of Hasura itself), but not the IP address of the client (X-Forwarded-For).

Two related issues (closed): https://github.com/hasura/graphql-engine/issues/2572 - this was a request about X-Forwarded-User-Agent that I have thanks to this issue https://github.com/hasura/graphql-engine/issues/4770 - about triggers and actions, but not remote schema. Actions send X-Forwarded-For

I would like to ask developers to add X-Forwarded-For header with client IP to remote schema when possible. Many thanks!

eizemazal avatar Feb 17 '21 16:02 eizemazal

Can you try to enable "Forward client headers"?

See: https://github.com/hasura/graphql-engine/issues/4770#issuecomment-661090478

tirumaraiselvan avatar Mar 01 '21 10:03 tirumaraiselvan

Can you try to enable "Forward client headers"?

See: #4770 (comment)

This option is enabled, but no header is sent.

eizemazal avatar Mar 01 '21 10:03 eizemazal

I have the same requirement and I'm also not seeing all the client headers forwarded when "Forward client headers" is checked. In my case, this is just for an Action. Thanks

mrab54 avatar Mar 23 '21 20:03 mrab54

Can confirm this is an issue with remote schema: No X-Fowarded-For header is passed over.

deathemperor avatar Jul 15 '21 07:07 deathemperor

Moved the project to Hasura 2.0.9 from Hasura 1.3.3 - the problem still exists, no way to find client IP address in remote schema, no x-forwarded-for header.

eizemazal avatar Oct 13 '21 11:10 eizemazal

still hoping this issue been solved

CHAOWEICHIU avatar Oct 21 '21 08:10 CHAOWEICHIU

Any updates? Are there any workarounds on how to access the original 'User-Agent' header in the webhook?

VIKI-09 avatar Oct 12 '22 18:10 VIKI-09