Enable disabling cache-control headers#3044
Enable disabling cache-control headers#3044hueniverse merged 1 commit intohapijs:masterfrom csabapalfi:disable-cache-control
Conversation
|
Is anyone looking at hapi PRs at all? @hueniverse? |
|
It would feel more consistent with existing API IMO if you could just set |
|
Thanks for the feedback, will simplify it and add tests! |
|
I am looking at PRs but this is not a high priority. Since I am not getting paid by anyone to do this, my priorities are pretty limited to security, major bugs, and stuff I need myself. Features like that tend to wait for a release for one of the above reasons (since I'm already spending time preparing it). That said, most things get merged pretty fast. This one is just very low on my list and has very little interest from other people. |
|
Understood and makes sense. Maybe just tagging it (even if the tag says low-priority) would let everyone know about the situation. Actually not touching the PR at all is probably even clearer. Thanks. |
|
@csabapalfi please make the changes suggested by @mtharrison |
|
@hueniverse Done. Thanks for looking into this! |
lib/schema.js
Outdated
| statuses: Joi.array().items(Joi.number().integer().min(200)).min(1) | ||
| }), | ||
| Joi.boolean().valid(false) | ||
| ), |
There was a problem hiding this comment.
Instead just add .allow(false) to the existing object rule.
There was a problem hiding this comment.
Thanks, that's much simpler. Done.
|
Can I suggest updating the docs as well stating this can be set to false? https://github.com/hapijs/hapi/blob/master/API.md#route-options |
|
@AdriVanHoudt 👍 Good point. Updated the docs. |
Signed-off-by: Csaba Palfi <[email protected]>
|
🚀 |
Enable disabling cache-control headers
|
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Sometimes you just don't want Cache-Control headers at all.
One example is old IE versions not loading fonts with a Cache-Control header.