Created
May 23, 2011 21:55
-
-
Save gmaurice/987708 to your computer and use it in GitHub Desktop.
This patch proposal allows clients to use ":" and "@" in params
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Net/HTTP/Spore/Request.pm b/lib/Net/HTTP/Spore/Request.pm | |
index 365e736..c08beb9 100644 | |
--- a/lib/Net/HTTP/Spore/Request.pm | |
+++ b/lib/Net/HTTP/Spore/Request.pm | |
@@ -150,7 +150,7 @@ sub uri { | |
my $base = $self->_uri_base; | |
- my $path_escape_class = '^A-Za-z0-9\-\._~/'; | |
+ my $path_escape_class = '^A-Za-z0-9\-\._~/@\:'; | |
my $path = URI::Escape::uri_escape($path_info || '', $path_escape_class); | |
@@ -260,7 +260,7 @@ sub finalize { | |
my $v = $params->[++$i]; | |
my $modified = 0; | |
- if ($path_info && $path_info =~ s/\:$k/$v/) { | |
+ if ($path_info && $path_info =~ s/\:$k/=$k/) { | |
$modified++; | |
} | |
@@ -291,6 +291,14 @@ sub finalize { | |
# clean remaining :name in url | |
$path_info =~ s/:\w+//g if $path_info; | |
+ | |
+ for ( my $i = 0 ; $i < scalar @$params ; $i++ ) { | |
+ my $k = $params->[$i]; | |
+ my $v = $params->[++$i]; | |
+ my $modified = 0; | |
+ | |
+ $path_info =~ s/=$k/$v/; | |
+ } | |
my $query_string; | |
if (scalar @$query) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment