Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

Mythweb - why fully qualified URLs?

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


manuel at mclure

Jun 18, 2010, 6:54 PM

Post #1 of 2 (454 views)
Permalink
Mythweb - why fully qualified URLs?

In looking at the code for MythWeb, I find that a lot of work is done
to generate fully qualified URLs of the form
"http://example.tld/mythweb/dir1/dir2/file.png" instead of using the
simpler "dir1/dir2/file.png" relative URL and letting the browser do
the work of completing the URL. This unfortunately causes problems if
you want to access MythWeb through a proxy server - the virtual
directory mapped on the proxy server has to have the exact same path
as the one on the mythweb server, and proxying from a non-ssl server
through an ssl server fails to work correctly.

For example, if http://server1/mythweb is a non-ssl server, and
https://server2/myth is proxying that URL, the URLs in the returned
page start with http://server2/mythweb - both the protocol and the
path are incorrect. I have fixed the SSL issue by adding an
examination of the HTTP_X_FORWARDED_PROTO in the code that checks for
SSL in includes/defines.php and making my proxy server set that
header, but I have had to make sure that the proxied path is the same
as the source server path.

I would like to put some effort into removing these fully qualified
URLs and replacing them with relative URLs, but I'm wondering whether
there is some specific reason that this work was put into place.
--
Manuel A. McLure WW1FA <manuel [at] mclure> <http://www.mclure.org>
...for in Ulthar, according to an ancient and significant law,
no man may kill a cat. -- H.P. Lovecraft
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


drees76 at gmail

Jun 18, 2010, 7:13 PM

Post #2 of 2 (441 views)
Permalink
Re: Mythweb - why fully qualified URLs? [In reply to]

On Fri, Jun 18, 2010 at 6:54 PM, Manuel McLure <manuel [at] mclure> wrote:
> In looking at the code for MythWeb, I find that a lot of work is done
> to generate fully qualified URLs of the form
> "http://example.tld/mythweb/dir1/dir2/file.png" instead of using the
> simpler "dir1/dir2/file.png" relative URL and letting the browser do
> the work of completing the URL. This unfortunately causes problems if
> you want to access MythWeb through a proxy server - the virtual
> directory mapped on the proxy server has to have the exact same path
> as the one on the mythweb server, and proxying from a non-ssl server
> through an ssl server fails to work correctly.

FWIW - I hit this same problem trying to access my MythWeb instance
through a reverse proxy... It rewrote the port numbers which weren't
the same and broke things... Relative links should be used unless
absolutely necessary as Manuel suggests.

-Dave
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.