Bugzilla – Attachment 113588 Details for
Bug 27009
Use 301 to redirect from tracklinks.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27009 - Use 301 to redirect from tracklinks.pl
Bug-27009---Use-301-to-redirect-from-tracklinkspl.patch (text/plain), 1.34 KB, created by
Magnus Enger
on 2020-11-13 09:53:49 UTC
(
hide
)
Description:
Bug 27009 - Use 301 to redirect from tracklinks.pl
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2020-11-13 09:53:49 UTC
Size:
1.34 KB
patch
obsolete
>From a7bd28ce0b08b5198425c6625eeb001a216dec51 Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@libriotech.no> >Date: Fri, 13 Nov 2020 10:44:29 +0100 >Subject: [PATCH] Bug 27009 - Use 301 to redirect from tracklinks.pl > >The default for the tracklinks.pl redirect is "302 Moved Temporarily". >It makes more sense to use "301 Moved Permanently". > >To test: >1. Set TrackClicks = Track >2. Make sure you have a MARC record with an external link in 856$u >3. In the OPAC, click on the link and use e.g. Developer tools to > check on the HTTP status code sent by tracklinks.pl. It will > be 302. >4. Apply this patch and restart all the things >5. Click on the external link in the OPAC again. The status code > should now be 301. >--- > opac/tracklinks.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/opac/tracklinks.pl b/opac/tracklinks.pl >index ab07f033be..ad9702230b 100755 >--- a/opac/tracklinks.pl >+++ b/opac/tracklinks.pl >@@ -78,7 +78,10 @@ if ($uri && ($biblionumber || $itemnumber) ) { > itemnumber => $itemnumber > } > ) if ( $tracker->trackingmethod() eq 'track' || $tracker->trackingmethod() eq 'anonymous' ); >- print $cgi->redirect($uri); >+ print $cgi->redirect( >+ -uri => $uri, >+ -status => '301 Moved Permanently', >+ ); > exit; > } > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27009
:
113588
|
113647