-
Type:
Bug
-
Resolution: Low Engagement
-
Priority:
Low
-
None
-
Affects Version/s: 7.3.3
-
Component/s: System Administration - General Configuration
-
7.03
-
3
-
Severity 3 - Minor
We are using a simple url rewrite rule for our renamed jira host.
After hours of analyzation, we recognized an issue in the tuckey urlrewriter.
The query string is replaced wrongly. The "?" is replaced by an "&".
In our current Jira version 7.3.3 we discovered Tuckey Urlrewriter 4.0.3.
The issue was fixed later in commit https://github.com/paultuckey/urlrewritefilter/commit/8047d4f3cbc7e0a890b24b9c60d9fdf526963e85, see issue:
https://github.com/paultuckey/urlrewritefilter/issues/116\\
The target release with this fix would be 4.0.5, but, unfortunately, there is still no release.
As a workaround, I created a tuckey urlrewriter release by myself and copied the jar file into the lib directory for testing - our rule worked and the query string was appended and replaced correctly, then.
Is it possible for you to integrate this fix into Jira?
For reference, you could take a look at my test release:
https://github.com/tirolerstefan/urlrewritefilter/releases/tag/urlrewritefilter-4.0.3-1\\
For details about reproduction, look at attached file.
--- Url Rewrite Rule (urlrewrite.xml) ---
<rule enabled="true">
<name>Redirection to besjira-test.eu.besi.corp</name>
<condition name="host" operator="notequal">^besijira-test.eu.besi.corp</condition>
<condition name="host" operator="notequal">^localhost</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true" qsappend="true">http://besijira-test.eu.besi.corp/$1</to>
</rule>
--- With urlrewritefilter 4.0.3 ---
=> "abc&x=1&y=2"
$ wget --no-proxy -S -O /dev/null 'http://onejira-test.eu.besi.corp/abc?x=1&y=2'
--2017-05-03 06:43:27-- http://onejira-test.eu.besi.corp/abc?x=1&y=2
Resolving onejira-test.eu.besi.corp (onejira-test.eu.besi.corp)... 10.10.9.226
Connecting to onejira-test.eu.besi.corp (onejira-test.eu.besi.corp)|10.10.9.226|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 301
Date: Wed, 03 May 2017 04:43:28 GMT
Server: Apache/2.4.7 (Ubuntu)
X-AREQUESTID: 403x6x1
X-ASEN: SEN-2072038
Location: http://besijira-test.eu.besi.corp/abc&x=1&y=2
Content-Type: text/html;charset=UTF-8
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Location: http://besijira-test.eu.besi.corp/abc&x=1&y=2 [following]
--- With urlrewritefilter 4.0.3-1 ---
(https://github.com/tirolerstefan/urlrewritefilter/releases/tag/urlrewritefilter-4.0.3-1)
=> "abc?x=1&y=2"
$ wget --no-proxy -S -O /dev/null 'http://onejira-test.eu.besi.corp/abc?x=1&y=2'
--2017-05-03 08:22:37-- http://onejira-test.eu.besi.corp/abc?x=1&y=2
Resolving onejira-test.eu.besi.corp (onejira-test.eu.besi.corp)... 10.10.9.226
Connecting to onejira-test.eu.besi.corp (onejira-test.eu.besi.corp)|10.10.9.226|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 301
Date: Wed, 03 May 2017 06:22:38 GMT
Server: Apache/2.4.7 (Ubuntu)
X-AREQUESTID: 502x4x1
X-ASEN: SEN-2072038
Location: http://besijira-test.eu.besi.corp/abc?x=1&y=2
Content-Type: text/html;charset=UTF-8
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Location: http://besijira-test.eu.besi.corp/abc?x=1&y=2 [following]