nickva commented on code in PR #5205:
URL: https://github.com/apache/couchdb/pull/5205#discussion_r1731371983


##########
src/chttpd/src/chttpd.erl:
##########
@@ -236,7 +236,15 @@ handle_request_int(MochiReq) ->
     % for the path, use the raw path with the query string and fragment
     % removed, but URL quoting left intact
     RawUri = MochiReq:get(raw_path),
-    {"/" ++ Path, _, _} = mochiweb_util:urlsplit_path(RawUri),
+    {Path0, _, _} = mochiweb_util:urlsplit_path(RawUri),
+    Path =
+        case Path0 of
+            "/" ++ ValidPath ->
+                ValidPath;
+            InvalidPath ->
+                couch_log:info("~p shutdown from invalid path ~p", [?MODULE, 
InvalidPath]),

Review Comment:
   I am slightly worried about dumping any random bytes they put in the path 
into the logs.
   
   Maybe we can just do `couch_stats:increment_counter([couchdb, httpd, 
aborted_requests])`?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to