-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[4.4] Rework redirect exception #7610
Conversation
Added documentation, tests and changes. |
The last comment.
This change is not documented. How about like this? --- a/user_guide_src/source/changelogs/v4.4.0.rst
+++ b/user_guide_src/source/changelogs/v4.4.0.rst
@@ -145,6 +145,10 @@ Changes
So if you installed CodeIgniter under the folder that contains the special
characters like ``(``, ``)``, etc., CodeIgniter didn't work. Since v4.4.0,
this restriction has been removed.
+- **HSTS:** Now :php:func:`force_https()` or
+ ``Config\App::$forceGlobalSecureRequests = true`` sets the HTTP status code 307,
+ which allows the HTTP request method to be preserved after the redirect.
+ In previous versions, it was 302.
Deprecations
************ |
@kenjis Thanks for the help. |
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.
Thank you!
Version of the new functionality. Co-authored-by: kenjis <[email protected]>
96b6dba
to
abb921a
Compare
@iRedds Thank you! |
Description
I would like to propose the following changes to the handling and use of
RedirectException
.RedirectException
now implementsResponsableInterface
ResponsableInterface
allows developers to add custom exceptions that will prepare the Response object themselves.The logic for generating a Response object for a
RedirectException
has been moved from theCodeigniter
class toRedirectException
, and theRedirectException
catch has been replaced with theResponsableInterface
.The
RedirectException
constructor now also accepts a ResponseInterface as its first argument. This allows the developer to set headers, cookies, for the Response object.The
CodeIgniter::forceSecureAccess()
method has been moved from therun()
method to thehandleRequest()
method, and theforce_https()
function has been redesigned so that it no longer terminates the script, but throws aRedirectException
, passing the exception to the constructor Response object. This approach will gracefully terminate the application.The
force_https()
function sets the HTTP status code 307, which allows the HTTP request method to be preserved after the redirect.Checklist: