Bug 3078 - CGI->redirect wants complete URI
Summary: CGI->redirect wants complete URI
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: PC All
: P5 - low minor (vote)
Assignee: Paul Poulain
QA Contact:
URL: http://search.cpan.org/~lds/CGI.pm-3....
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-31 07:26 UTC by Chris Cormack
Modified: 2017-06-14 22:10 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:06:09 UTC


---- Reported by joe.atzberger@liblime.com 2009-03-31 19:26:05 ----

Although it goes against my preference, the perldoc for CGI says: "You should always use full URLs (including the http: or ftp: part) in redirection requests. Relative URLs will not work correctly."

Koha issues redirects with relative URL's, because it is so much easier than doing all the logic for figuring out what the full URL should be.  If you think it is easy, just use the Apache SERVER_NAME and SCRIPT_NAME and QUERY_STRING variables, you have not considered the interjection of proxies, mod_rewrite, load balancing and SSL. 

We should make a centralized function for printing redirects that is aware of all the various permutations, and convert to using it.  We might need to recognize the HTTP Headers "X-Forwarded-Host" and "X-FORWARDED-PROTO".  

We may conclude that we are going to use CGI redirect w/ relative URL's anyway, but their docs seem clear on that point.  

As a side note, it would be better practice if we had fewer redirects.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:06 UTC  ---

This bug was previously known as _bug_ 3078 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3078

Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was joe.atzberger@liblime.com.

Comment 1 Paul Poulain 2011-08-02 13:47:16 UTC
it's a minor problem, no one has complained about this already. Joe has left, does anyone have an idea about how to solve this problem ? A patch maybe ?