-
-
Notifications
You must be signed in to change notification settings - Fork 989
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
feat(middleware): add sunset/deprecation header middleware #844
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this feature. However, should we wait for the Sunset
header to actually make it into an RFC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I think this is useful, especially since these headers are defined in RFC8594 - https://www.rfc-editor.org/rfc/rfc8594.html.
Let's see if @pkieltyka agrees this can be merged into github.com/go-chi/chi/v5/middleware :)
Respect previously added links as this header can be used by other components
thanks for the PR @thedevsaddam and thanks for reviewing @VojtechVitek |
Thank you so much for this amazing package! |
Pardon my curiosity - I saw this PR while browsing through the changelog. I see that RFC 8594 defines the "Sunset" header but makes no mention of the "Deprecation" header. I did find this IETF draft which mentions the "Deprecation" header but it seems to serve a slightly different purpose:
There is also mention of the Sunset header, which uses a different time format:
This PR returns both headers set to the same time and format:
Perhaps the |
This PR will include a
Sunset
middleware which can be used to deprecate an endpoint or a group of endpoints.For additional information please go through the LINK
Example usages