summaryrefslogtreecommitdiffstats
path: root/calibre
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2013-10-17 15:12:44 +0000
committer Eric Hameleers <alien@slackware.com>2013-10-17 15:12:44 +0000
commitc2cc103490e385b1232943024f36435bae187477 (patch)
treee39c24e02fa6c1dd704e115254739b7b3d51d418 /calibre
parentb9d788c93ac8a7c3e8d0a01a0992b9e4e3b9b2a0 (diff)
downloadasb-c2cc103490e385b1232943024f36435bae187477.tar.gz
asb-c2cc103490e385b1232943024f36435bae187477.tar.xz
Initial revision
Diffstat (limited to 'calibre')
-rw-r--r--calibre/build/patches/calibre_single_item_category.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/calibre/build/patches/calibre_single_item_category.patch b/calibre/build/patches/calibre_single_item_category.patch
new file mode 100644
index 00000000..be39c885
--- /dev/null
+++ b/calibre/build/patches/calibre_single_item_category.patch
@@ -0,0 +1,21 @@
+# Content server: Use internal redirect for single item categories
+# Content server: Fix single item categories not working with reverse
+# proxy setup. Fixes #1238987 [Calibre behind apache server sometimes returns 'localhost' URLs](https://bugs.launchpad.net/calibre/+bug/1238987)
+#
+# Single item categories were using HTTP 303 redirects which are resolved to
+# http://localhost:8080 absolute URLs by cherrpy (since cherrypy has no
+# knowledge of whatever server the apache process is exposed as). SO
+# instead we use an internal redirect, which does not suffer from this
+# issue. It does mean that bookmarking the URL wil have unexpected
+# side-effects if the number of items in the catefory ever increases to
+# more than one.
+
+@@ -500,7 +500,7 @@ def browse_category(self, category, sort):
+ datatype, self.opts.url_prefix)
+ href = re.search(r'<a href="([^"]+)"', html)
+ if href is not None:
+- raise cherrypy.HTTPRedirect(href.group(1))
++ raise cherrypy.InternalRedirect(href.group(1))
+
+ if len(items) <= self.opts.max_opds_ungrouped_items:
+ script = 'false'