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

No access to X-Forwarded-For or to arbitrary headers #155

Open
adrien-n opened this issue Oct 7, 2018 · 1 comment
Open

No access to X-Forwarded-For or to arbitrary headers #155

adrien-n opened this issue Oct 7, 2018 · 1 comment

Comments

@adrien-n
Copy link

adrien-n commented Oct 7, 2018

Hi,

I have been trying to retrieve the X-Forwarded-For header and have failed to find a dedicated API so far (like there is for Host). I haven't seen a way to access a header by name (I was looking for a function of type string -> string (option)). It seems to me that the information is not accessible and actually not even stored. Could such accessors be added? I'm sorry if this already exists and I have merely not spotted it.

@vouillon
Copy link
Member

You can do this:

Http_headers.find (Http_headers.name "X-Forwarded-For")
        hds.Ocsigen_http_frame.Http_header.headers

From Eliom, you can get the header with:

let hds = Eliom_request_info.get_http_header () in

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

2 participants