Skip to content

Host or host? #163

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

Closed
ray-x opened this issue Dec 29, 2022 · 2 comments · Fixed by #236
Closed

Host or host? #163

ray-x opened this issue Dec 29, 2022 · 2 comments · Fixed by #236

Comments

@ray-x
Copy link

ray-x commented Dec 29, 2022

In sample:

GET /api/users?page=5 HTTP/1.1
Host: reqres.in:443

But in code it check host:

if headers["host"] ~= nil then
headers["host"] = headers["host"]:gsub("%s+", "")
headers["host"] = string.gsub(headers["host"], "%s+", "")
parsed_url.url = headers["host"] .. parsed_url.url
headers["host"] = nil
end

This makes the sample not work,
Is the sample incorrect or the request/init.lua is incorrect?

@teto
Copy link
Collaborator

teto commented Dec 29, 2022

closing as duplicate of #157 . There is an issue with casing of the headers at the moment. I think we need to generate a normalized version of the headers but keep sending the original headers. PR welcome

@teto teto closed this as completed Dec 29, 2022
@teto teto reopened this Dec 30, 2022
@teto
Copy link
Collaborator

teto commented Dec 30, 2022

we merged a fix for content-type but not for that one so reopening

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

Successfully merging a pull request may close this issue.

2 participants