Skip Menu |

This queue is for tickets about the Dancer-Plugin-Assets CPAN distribution.

Report information
The Basics
Id: 94334
Status: new
Priority: 0/
Queue: Dancer-Plugin-Assets

People
Owner: Nobody in particular
Requestors: FGA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.52
Fixed in: (no value)



Subject: Dancer::Plugin::Assets does not support arbitrary mountpoints for applications
I have an application running on http://localhost:5000, mounted at "/foo" by a Plack script (actual mountpoint changed to protect the innocent). Dancer::Plugin::Assets does not seem to be aware of mountpoints, and builds URLs assuming the application is mounted at "/", so I get http://localhost:5000/static/minified.css instead of http://localhost:5000/foo/static/minified.css which of course causes 404s all over the place. This can be fixed by using Dancer's own URI-building functions, so my $url = _url( $setting->{url} ); would become my $url = request->uri_for( _url( $setting->{url} ) ); and the _url sub would only contain the logic for making sure there are no double slashes in the resulting path. _site_url, _scheme and _host would no longer be needed. In the meantime, this can be sort of worked around by putting the mountpoint in the plugin's configuration, but this is awkward since mountpoints are not actually part of the app's configuration in theory (a properly portable app should not care about where its mountpoint is).