Skip to content

Commit

Permalink
[backend] BSRPC: fix uri encoding if there is no host part
Browse files Browse the repository at this point in the history
This happens if called from BSHandoff (i.e. if there already is a socket).
  • Loading branch information
mlschroe committed Jul 10, 2014
1 parent 94e9ad2 commit 1d665ea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/backend/BSRPC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ sub urlencode {
sub createuri {
my ($param, @args) = @_;
my $uri = $param->{'uri'};
if (!$param->{'verbatim_uri'} && $uri =~ /^(https?:\/\/[^\/]*\/)(.*)$/s) {
$uri = $1;
$uri .= BSRPC::urlencode($2);
if (!$param->{'verbatim_uri'}) {
# encode uri, but do not encode the host part
if ($uri =~ /^(https?:\/\/[^\/]*\/)(.*)$/s) {
$uri = $1;
$uri .= urlencode($2);
} else {
$uri = urlencode($uri);
}
}
if (@args) {
for (@args) {
Expand Down

0 comments on commit 1d665ea

Please sign in to comment.