Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting request header dynamically using Javascript #61

Open
matheuskoiti opened this issue Dec 18, 2019 · 0 comments
Open

Getting request header dynamically using Javascript #61

matheuskoiti opened this issue Dec 18, 2019 · 0 comments

Comments

@matheuskoiti
Copy link

Hello,

I'm trying to retrieve a value from a request header for using at body content section for my response. The request header the client sends looks like it:
Authorization: 123#abc

Then, at body content section at DuckRails, I tried to read that value this way:
var header = headers['Authorization'].split('#')[1];

But when I test the response I get a 200 Ok, but with this error:

Duckrails-Error: TypeError: Cannot read property 'split' of undefined

Am I reading the headers in a wrong way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant