Skip Menu |

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

Report information
The Basics
Id: 128009
Status: new
Priority: 0/
Queue: Dancer-Plugin-RequireSSL

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

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



Subject: Strip port before redirecting
If the original URI had a port, then this port will be retained in the redirected https URI. I think it's nearly impossible (or at least difficult to implement) to serve both http or https from the same port. A simple solution would be to strip the port from the req.host field: (my $host_without_port = $req->host) =~ s{:\d+$}{}; my $url = 'https://' . $host_without_port . $req->path; While at this, maybe it would be a good idea to add a configuration setting to change the https port, if it's necessary. Possible implementation (completely untested): my $port = ''; my $plugin_settings = plugin_setting; if ($plugin_settings->{https_port}) { $port = ":$plugin_settings->{https_port}"; } my $url = 'https://' . $host_without_port . $port . $req->path;