We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This issue is in three parts:
no-transform
This directive has no arguments (either in current RFC 9111 or older RFC 2616)
from werkzeug.http import parse_cache_control_header cc = parse_cache_control_header("no-transform") print(f"{cc.no_transform=}")
Output:
cc.no_transform=None
Expected: boolean based on presence
min-fresh
"*"
from werkzeug.http import parse_cache_control_header cc = parse_cache_control_header("min-fresh") print(f"{cc.min_fresh=}")
cc.min_fresh='*'
Expected: None since the argument is required and "*" doesn't have a semantic meaning for this directive.
None
no_cache
str
bool
max_stale
int
RequestCacheControl
Environment:
The text was updated successfully, but these errors were encountered:
They are all None if not present, the empty value is used if the directive is present but has no argument:
>>> from werkzeug.http import parse_cache_control_header >>> parse_cache_control_header("max-stale").max_stale '*' >>> parse_cache_control_header("max-stale=1").max_stale 1 >>> parse_cache_control_header("").max_stale None
* is currently used in a few other places that you haven't called out here
*
Those have optional arguments and * is at least handy as a truthy value.
-1 also doesn't make sense for max-age compared to None if not given
-1
I agree. iirc Chromium treats max-age without the required argument as if the directive wasn't there.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
This issue is in three parts:
no-transform
directive always returns NoneThis directive has no arguments (either in current RFC 9111 or older RFC 2616)
Output:
Expected: boolean based on presence
min-fresh
directive returns"*"
if missing required argumentOutput:
Expected:
None
since the argument is required and"*"
doesn't have a semantic meaning for this directive.type stubs are incorrect
no_cache
returnsstr
notbool
.bool
properties never returnNone
max_stale
returns"*"
in addition toint
.RequestCacheControl
immutability is not reflected.Environment:
The text was updated successfully, but these errors were encountered: