Comment 2 for bug 1710747

Revision history for this message
Dan Scott (denials) wrote :

Thanks for this, Kathy! I'm concerned that there might be a deeper problem here, as ctx.media_prefix is used elsewhere to point to the hostname where the media is served from, which could be different from ctx.hostname. (Historically the division was to overcome the maximum number of parallel connections that browsers would make to a single hostname).

But if ctx.media_prefix is unset, then in this context it is null and seems to be null in every other use within src="" attributes in other templates.

A different approach would be to modify OpenILS/WWW/EGWeb.pm from:

$ctx->{media_prefix} = $r->dir_config('OILSWebMediaPrefix');

to:

$ctx->{media_prefix} = $r->dir_config('OILSWebMediaPrefix') || $r->hostname;

That is, ensuring that ctx.media_prefix is always set to an explicit hostname, thus making every reference absolute. This would also avoid modifying every OPAC and KPAC reference to ctx.media_prefix too :)

I'll test and post an alternate branch if I'm successful...