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
Dream.static is returning incorrect headers for non-exists file #88
Comments
Should be fixed by 809835d. The issue was that when the response is not one of the 2xx responses that carries content, |
Thanks! Can you try comparing on Safari to 404 page from a Dream app without a 404 template, but outside |
@aantron it shows blank page as well. But I want to test non-dream behavior |
Understood. It was just a partial comparison you could do cheaply (since I don't have Safari) — thanks! It's actually a bit disappointing that Safari has this behavior. Part of the reason I used blank replies by default is that Chrome's stand-in pages are localized by Chrome (at least on my system with my versions). So not using an error template actually helps with localization, while providing an English template would positively harm it. Safari's blank page behavior undermines this pretty completely. |
That is, if Dream tried to provide its own default cookie-cutter templates, without knowing what the localization needs of each app are (if any). |
@aantron oh. I don't suggest Dream would provide default error template. Is there a way for me to provide a catch all hook for error pages? |
Absolutely, that's the intended way to do it, and Dream will even capture lower-level errors (so, all errors) and forward them to you hook. See the error example, also in the playground, and its API docs:
|
Given a static route like this one
Try to access random route would have these behavior:
ERR_INVALID_RESPONSE
dream.log
shows 404curl -v -o - http://localhost:5000/not-exists
@aantron said on Discord that those headers shouldn't be there.
The text was updated successfully, but these errors were encountered: