From 2a336ab7a7b9aea2bdee2137ee1f46c908539840 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 14 Oct 2013 19:12:03 +0530 Subject: [PATCH] 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. --- src/calibre/library/server/browse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py index 383d53f849..470eb0c1f3 100644 --- a/src/calibre/library/server/browse.py +++ b/src/calibre/library/server/browse.py @@ -500,7 +500,7 @@ class BrowseServer(object): datatype, self.opts.url_prefix) href = re.search(r'