Skip to content

Commit 8b85036

Browse files
committed
docs: add changelog and upgrade
1 parent bd8a0fd commit 8b85036

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

user_guide_src/source/changelogs/v4.5.0.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ Others
118118
Removed Deprecated Items
119119
========================
120120

121+
Request
122+
-------
123+
124+
- The ``$upper`` parameter in ``getMethod()`` in ``RequestInterface`` and ``Request``
125+
has been removed. See :ref:`upgrade-450-lowercase-http-method-name`.
126+
- The deprecated ``isValidIP()`` method in ``RequestInterface`` and ``Request``
127+
has been removed.
128+
- The visibility of the deprecated properties ``$uri`` and ``$config`` in
129+
``IncomingRequest`` has been changed to protected.
130+
121131
Filters
122132
-------
123133

@@ -183,10 +193,6 @@ Spark Commands
183193
Others
184194
------
185195

186-
- **IncomingRequest:** The visibility of the deprecated properties ``$uri`` and
187-
``$config`` has been changed to protected.
188-
- **RequestInterface:** The deprecated ``isValidIP()`` method has been removed.
189-
- **Request:** The deprecated ``isValidIP()`` method has been removed.
190196
- **Config:** The deprecated ``CodeIgniter\Config\Config`` class has been removed.
191197

192198
Enhancements

user_guide_src/source/installation/upgrade_450.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,35 @@ Mandatory File Changes
1818
Breaking Changes
1919
****************
2020

21+
.. _upgrade-450-lowercase-http-method-name:
22+
23+
Lowercase HTTP Method Name
24+
==========================
25+
26+
For historical reasons, ``Request::getMethod()`` returned HTTP method names in
27+
lower case by default.
28+
29+
But the method token is case-sensitive because it might be used as a gateway
30+
to object-based systems with case-sensitive method names. By convention,
31+
standardized methods are defined in all-uppercase US-ASCII letters.
32+
See https://www.rfc-editor.org/rfc/rfc9110#name-overview.
33+
34+
Now the deprecated ``$upper`` parameter in ``Request::getMethod()`` has been
35+
removed, and the ``getMethod()`` returns the as-is HTTP method name. That is,
36+
uppercase like "GET", "POST", and so on.
37+
38+
If you want lowercase HTTP method names, use PHP's ``strtolower()`` function::
39+
40+
strtolower($request->getMethod())
41+
42+
And you should use uppercase HTTP method names in your app code. You should update
43+
the keys in ``$methods`` in **app/Config/Filters.php**::
44+
45+
public array $methods = [
46+
'POST' => ['invalidchars', 'csrf'],
47+
'GET' => ['csrf'],
48+
];
49+
2150
.. _upgrade-450-nested-route-groups-and-options:
2251

2352
Nested Route Groups and Options

0 commit comments

Comments
 (0)