hakko/subsonic — pull request #32 by ties (2013-01-06 22:17:06+00:00)
Title: Better detection of last.fm callback URL

At the moment the LastFmSettingsController creates a callback URL that might not work in some situations. For example, when SubSonic is behind a reverse proxy, it might create a callback referring to localhost.

The real solution is to fix the reverse proxy setup, ie:
```apache
ProxyPreserveHost On

ProxyPass http://localhost:4040/ retry=5
ProxyPassReverse http://localhost:4040/

…

```

However, re-using the approach used by ``net.sourceforge.subsonic.service.ShareService#getShareBaseUrl`` should provide the behavior the user expects, except in the situation where the local hostname is not a global hostname (i.e. when using a lan-only name).

This pull request contains a (quick) implementation callback url detection based on the strategry used by ShareService. However, when no setting is found it uses the complete request URL as fallback instead of trying to detect the hostname.

I hope it fully works – I was not able to test the situation where subsonic is reachable using a ``*.subsonic.com`` name.