Bug 18714

Summary: tracklinks.pl redirects failing under https
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Nick Clemens (kidclamp) 2017-06-01 12:44:41 UTC
When a site is using https the CGI->redirect() command in tracklinks.pl receives a url with "http" but sends the uder via "https" and some links fail

To test:
1 - Enable https
2 - Add an url to a record that is accessible only via http
3 - Enable track links system preference
4 - Click the link from the opac
5 - Security failure or timeout (as you are redirected to https
Comment 1 Nick Clemens (kidclamp) 2017-08-06 10:24:05 UTC
This was an error in proxy configuration and not Koha related
Comment 2 Nick Clemens (kidclamp) 2022-08-03 14:32:09 UTC
This wa related to a proxy rule to forward all http to https, we just needed to limit it to koha urls. 

We changed:
http-response replace-value Location ^http://(.*) https://\1 if { ssl_fc }

To:
http-response replace-value Location ^http://(.*)/cgi-bin/koha/(.*) https://\1/cgi-bin/koha/\2 if { ssl_fc }