Not able to access custom header in request coming from client

14 views
Skip to first unread message

Nicks

unread,
Jul 15, 2016, 6:57:47 AM7/15/16
to LoopbackJS
Hi,

Client is sending 'access_token' in request header , and some other keys as well. Other than 'access_token', we can handle all others.

We can see all keys coming  (access_token as well) in request header on developers tools network tab though.

Is there anything to do with key name 'access_token' ?

Regards,
Nikhil


Nuba Princigalli

unread,
Jul 15, 2016, 10:31:06 AM7/15/16
to loopb...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/3304215c-7923-46c1-a1e8-05b36ce21515%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nuba Princigalli

unread,
Jul 15, 2016, 10:47:50 AM7/15/16
to loopb...@googlegroups.com
Also, at the risk of stating the obvious, but...

Don't trust "what your code at the client is sending" to be the same as "what your code at the server is getting". Verify. Specially if your request is going over the internet: there are many different types of HTTP layers which could be standing, often transparently, between you and your server (cache, load balancer, proxies, etc...).

So, pick some debugger, like https://www.npmjs.com/package/node-debug, so you can inspect your code (and what's available to it) at runtime.

Myself, I use Webstorm and find it easy to add and toggle breakpoints and inspect stuff with its node debug tool.

Nikhil Jain

unread,
Jul 15, 2016, 10:54:21 AM7/15/16
to loopb...@googlegroups.com

Hey Nuba,

Thanks for the suggestions. I think I have found the problem, actually our nginx is dropping the headers with underscore. Because it is treated as invalid header.

Updating nginx server settings to check whether it works after that.

Anyway thanks a lot.

You received this message because you are subscribed to a topic in the Google Groups "LoopbackJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/loopbackjs/356DtpcV798/unsubscribe.
To unsubscribe from this group and all its topics, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/CAMGJnyuN3pQT6mz-DcRKV8CNQa%3DXZcgbB7u-4DP6L-ZiXVXfHg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages