Supporting empty Location URIs.
An empty string in Location was being handled specially by not sending a Location header. This may occur after variable resolution, so we need to consider this scenario. The obsolete RFC 2616 defined the Location header as consisting of an absolute URI <https://www.rfc-editor.org/rfc/rfc2616#section-14.30>, which cannot be an empty string. However, the current RFC 7231 allows the Location to be a relative URI <https://www.rfc-editor.org/rfc/rfc7231#section-7.1.2>, and a relative URI may be an empty string <https://stackoverflow.com/a/43338457>. Due to these considerations, this patch allows sending an empty Location header without handling this case specially. This behavior will probably be more straightforward to users, too. It also simplifies the code, which is now more readable, fast, and conformant to the current RFC. We're skipping an allocation at request time in a common case such as "action": {"return": 404}
This commit is contained in:
@@ -37,6 +37,12 @@ Ruby Rack environment parameter "SCRIPT_NAME" support.
|
||||
</para>
|
||||
</change>
|
||||
|
||||
<change type="change">
|
||||
<para>
|
||||
supporting empty strings in the "location" option of the "return" action.
|
||||
</para>
|
||||
</change>
|
||||
|
||||
<change type="feature">
|
||||
<para>
|
||||
variables support in the "location" option of the "return" action.
|
||||
|
||||
Reference in New Issue
Block a user