Page 1 of 1
only HTTPS results in error in remote access (0.6.10)
Posted: November 5th, 2011, 8:51 am
by sander
SAB 0.6.10.
HTTPS is on, and port is empty, so "If empty, the standard port will only listen to HTTPS.". This works when working on localhost. Connecting to http redirects to
https://localhost:8080/
However, accessing SAB from a different machine (for example 192.168.1.48) on the LAN, so http:192.168.1.53:8080 results in a rewrite/redirect to
https://localhost:8080/sabnzbd, which does of course not work from that other computer.
Expected result: keep the IP-address in there.
Re: only HTTPS results in error in remote access (0.6.10)
Posted: November 5th, 2011, 2:54 pm
by sander
Easy method to get an idea of my bug report with just one machine:
SABnzbd: check HTTPS to ON, and remove the port number at HTTPS. Make sure
http://localhost:8080/ redirects to https.
Then connect to http://<LAN-IP-address>:8080/, for example
http://192.168.1.53:8080/ ... it will redirect to
https://localhost:8080/sabnzbd/ , and not
https://192.168.1.53:8080/sabnzbd/ . That's the cause of my bug report.
Re: only HTTPS results in error in remote access (0.6.10)
Posted: November 7th, 2011, 3:03 am
by shypike
There's only one redirection address set: localhost.
Instead, it should be the most "public" address.
The redirection as it is now, is an ugly patch on the CherryPy module, because
it doesn't support redirection at all.
I'll see what I can do.
Re: only HTTPS results in error in remote access (0.6.10)
Posted: November 7th, 2011, 3:53 am
by sander
shypike wrote:There's only one redirection address set: localhost.
Instead, it should be the most "public" address.
The redirection as it is now, is an ugly patch on the CherryPy module, because
it doesn't support redirection at all.
I'll see what I can do.
I believe the address used is in the HTTP request. I think there should be redirection to that address, as it could be all kinds of stuff in there: private LAN IPv4 address, a bonjour name, IPv6 address.
Re: only HTTPS results in error in remote access (0.6.10)
Posted: November 7th, 2011, 2:23 pm
by shypike
What you ask is not possible.
CherryPy does not make this info available, assuming it's even received.
All there is the host IP and the remote IP (both in numerical form only).
So if remote-IP == 127.0.0.1 or ::1 it's safe to assume that localhost is the redirect.
If not, then the public address of SABnzbd's host should be used.
Currently, having the host set as 0.0.0.0 will always give a redirect to localhost. This is not correct, obviously.
Re: only HTTPS results in error in remote access (0.6.10)
Posted: November 7th, 2011, 3:36 pm
by sander
Since HTTP 1.1 or so (so: 15 years ago ;-) ), the HTTP request contains the FQDN / requested host name. Reason: only that way you can put more than one webserver on one IP address. See
http://en.wikipedia.org/wiki/Hypertext_ ... nt_request for an example what the HTTP client says at the "Host" part.
I know nothing about cherrypy, so maybe cherrpy doesn't provide the Host info, but maybe it does. As a a guess:
http://docs.cherrypy.org/dev/refman/lib ... #functions seems to be about HTTP. However, I don't understand if these functions provide info about the HTTP-request that was received (or that they create a HTTP-reply).