View Single Post
Old 10-28-2018, 01:28 PM   #1
Gnoop
Junior Member
Gnoop began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Oct 2018
Device: none
url-prefix missing on some AJAX calls to calibre-server

Hello,

I'm running Calibre Server as a headless service on a Windows Server. To make the URLs more user-friendly, it sits behind a reverse proxy that redirects all requests for HTTP://SERVER:PORT/* to HTTP://SERVER/BOOKS/* and I am using the "--url-prefix" argument to request that Calibre output URLs pointing to the redirected site.

This works fine for general browsing; I can go to the root of the site, select a library, and browse and download books as expected. However, when I try to use the conversion feature for a book (which I am very thankful for, BTW, as we are a multi-format household) it allows me to select conversion options but fails with a 404 error when I click the "start conversion" button.

Looking at the HTTP traffic for a session, I see the following:

http://SERVER/BOOKS/ajax-setup?1540746967583
http://SERVER/BOOKS/interface-data/update?1540746967830
http://SERVER/BOOKS/interface-data/b...&1540746967840
http://SERVER/BOOKS/conversion/book-...&1540746976371
http://SERVER/BOOKS/conversion/book-...&1540746979428

but the action of clicking the "start conversion" button makes a call to:

http://SERVER/conversion/start/8?lib...uthor_sort.asc

I had a quick look at the source code, and the endpoints defined in server/convert.py look sensible; my only thought was that there are two functions in server/routes.py called "url_for" and only one of them seems to explicitly add the url prefix.

Any suggestions?

Thanks for an incredibly useful program!
Gnoop is offline   Reply With Quote