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 2022/07/14 17:20:01 UTC

[GitHub] [couchdb] big-r81 commented on a diff in pull request #4108: Trim X-Auth-CouchDB-Roles header after reading

big-r81 commented on code in PR #4108:
URL: https://github.com/apache/couchdb/pull/4108#discussion_r921398242


##########
src/couch/src/couch_httpd_auth.erl:
##########
@@ -189,7 +189,7 @@ proxy_auth_user(Req) ->
             Roles =
                 case header_value(Req, XHeaderRoles) of
                     undefined -> [];
-                    Else -> [?l2b(R) || R <- string:tokens(Else, ",")]
+                    Else -> re:split(Else, "\\s*,\\s*", [trim, {return, binary}])

Review Comment:
   Aah, good catch, I misread the `trim` option, I thought it was string:trim/1...
   So, Should we do something like this?
   ```
   re:split(string:trim(Else), "\\s*,\\s*", [trim, {return, binary}])
   ```



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

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