You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/05/04 21:36:01 UTC

[GitHub] [couchdb-ibrowse] jiahuili430 opened a new pull request #5: Unquote basic auth username and password

jiahuili430 opened a new pull request #5:
URL: https://github.com/apache/couchdb-ibrowse/pull/5


   Unquote username and password which were parsed by ibrowse_lib:parse_url/1 before inserting them in the basic auth header.
   
   Previously if the user had characters like @ in their username or password, and they were percent-encoded, they were inserted encoded in the basic auth header which lead to authentication failure.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-ibrowse] iilyak commented on a change in pull request #5: Unquote basic auth username and password

Posted by GitBox <gi...@apache.org>.
iilyak commented on a change in pull request #5:
URL: https://github.com/apache/couchdb-ibrowse/pull/5#discussion_r626468444



##########
File path: src/ibrowse_lib.erl
##########
@@ -439,4 +468,15 @@ parse_url_test() ->
               ?assertMatch(Expected_result, parse_url(Url))
       end, Urls).
 
+unquote_test() ->
+    ?assertEqual("foo bar",
+        unquote("foo+bar")),
+    ?assertEqual("foo bar",
+        unquote("foo%20bar")),
+    ?assertEqual("foo\r\n",
+        unquote("foo%0D%0A")),
+    ?assertEqual("foo\r\n",
+        unquote(<<"foo%0D%0A">>)),

Review comment:
       The difference is `binary()` vs `string()`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-ibrowse] bessbd merged pull request #5: Unquote basic auth username and password

Posted by GitBox <gi...@apache.org>.
bessbd merged pull request #5:
URL: https://github.com/apache/couchdb-ibrowse/pull/5


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-ibrowse] jiahuili430 commented on a change in pull request #5: Unquote basic auth username and password

Posted by GitBox <gi...@apache.org>.
jiahuili430 commented on a change in pull request #5:
URL: https://github.com/apache/couchdb-ibrowse/pull/5#discussion_r626527363



##########
File path: src/ibrowse_lib.erl
##########
@@ -439,4 +468,15 @@ parse_url_test() ->
               ?assertMatch(Expected_result, parse_url(Url))
       end, Urls).
 
+unquote_test() ->
+    ?assertEqual("foo bar",
+        unquote("foo+bar")),
+    ?assertEqual("foo bar",
+        unquote("foo%20bar")),
+    ?assertEqual("foo\r\n",
+        unquote("foo%0D%0A")),
+    ?assertEqual("foo\r\n",
+        unquote(<<"foo%0D%0A">>)),

Review comment:
       Thanks, @iilyak @bessbd 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-ibrowse] bessbd commented on a change in pull request #5: Unquote basic auth username and password

Posted by GitBox <gi...@apache.org>.
bessbd commented on a change in pull request #5:
URL: https://github.com/apache/couchdb-ibrowse/pull/5#discussion_r626469745



##########
File path: src/ibrowse_lib.erl
##########
@@ -439,4 +468,15 @@ parse_url_test() ->
               ?assertMatch(Expected_result, parse_url(Url))
       end, Urls).
 
+unquote_test() ->
+    ?assertEqual("foo bar",
+        unquote("foo+bar")),
+    ?assertEqual("foo bar",
+        unquote("foo%20bar")),
+    ?assertEqual("foo\r\n",
+        unquote("foo%0D%0A")),
+    ?assertEqual("foo\r\n",
+        unquote(<<"foo%0D%0A">>)),

Review comment:
       Thanks, @iilyak !




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-ibrowse] bessbd commented on a change in pull request #5: Unquote basic auth username and password

Posted by GitBox <gi...@apache.org>.
bessbd commented on a change in pull request #5:
URL: https://github.com/apache/couchdb-ibrowse/pull/5#discussion_r626355415



##########
File path: src/ibrowse_lib.erl
##########
@@ -439,4 +468,15 @@ parse_url_test() ->
               ?assertMatch(Expected_result, parse_url(Url))
       end, Urls).
 
+unquote_test() ->
+    ?assertEqual("foo bar",
+        unquote("foo+bar")),
+    ?assertEqual("foo bar",
+        unquote("foo%20bar")),
+    ?assertEqual("foo\r\n",
+        unquote("foo%0D%0A")),
+    ?assertEqual("foo\r\n",
+        unquote(<<"foo%0D%0A">>)),

Review comment:
       This looks like the same as right above.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-ibrowse] bessbd commented on pull request #5: Unquote basic auth username and password

Posted by GitBox <gi...@apache.org>.
bessbd commented on pull request #5:
URL: https://github.com/apache/couchdb-ibrowse/pull/5#issuecomment-832671177


   Thank you for the review, @iilyak ! I'm about to merge this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-ibrowse] bessbd commented on pull request #5: Unquote basic auth username and password

Posted by GitBox <gi...@apache.org>.
bessbd commented on pull request #5:
URL: https://github.com/apache/couchdb-ibrowse/pull/5#issuecomment-832672629


   For posterity: I believe this is related to https://github.com/apache/couchdb/issues/2892


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org