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

May be a bug in handler.lua #133

Open
lingbl opened this issue May 3, 2023 · 1 comment
Open

May be a bug in handler.lua #133

lingbl opened this issue May 3, 2023 · 1 comment

Comments

@lingbl
Copy link

lingbl commented May 3, 2023

code in handler.lua:

if self.callback then
response:statusCode(200)
response.headers = {} -- response._headers = {} ???????????????????????????
response:addHeader('Content-Type', 'text/html')

self.callback(request, response)

end

@Tieske
Copy link
Contributor

Tieske commented May 3, 2023

If the code before it (while trying to serve a file), had already set some headers before it failed for some reason, then the headers get cleared. This makes sense to me.

Though I agree that the mixing of file handling and callbacks is not very clean, can could be improved upon, which would also fix your concern.

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