Skip to content

Conversation

@da2x
Copy link

@da2x da2x commented Apr 14, 2022

The argument sets an optional Cache-Control header for redirects. Allows for more fined-grained control over client and browser caching for known short- and long-lived redirects. The argument accepts an integer value with the number of seconds to add to the max-age directive. Browser support: universal.

The argument sets an optional Cache-Control header for redirects. Allows for
more fined-grained control over browser caching for known short- and long-
lived redirects.
Copy link
Member

@avelino avelino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to write doc and test validating the functioning of your implementation

code = 303 if request.get('SERVER_PROTOCOL') == "HTTP/1.1" else 302
res = response.copy(cls=HTTPResponse)
res.status = code
if type(cache) is int:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can check if the variable exists, you don't need to look at its type.
If it is an unexpected string it will be the developer's responsibility

@avelino avelino added Feature This is a feature request, not a bug. Open for discussion. Needs tests This feature or fix needs a test-case to ensure it continues to work in the future. Needs docs This feature lacks documentation labels May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature This is a feature request, not a bug. Open for discussion. Needs docs This feature lacks documentation Needs tests This feature or fix needs a test-case to ensure it continues to work in the future.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants