From 4b2b7ea292a8899c7915b59177e4d83959c9b9ea Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 6 Apr 2017 16:54:47 -0700 Subject: [PATCH] ircd::http: Allow elision of leading slash and empty '?' query. --- ircd/http.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ircd/http.cc b/ircd/http.cc index 3680acb2b..59e741287 100644 --- a/ircd/http.cc +++ b/ircd/http.cc @@ -165,7 +165,7 @@ struct grammar rule query_val { raw[*(char_ - query_illegal)] ,"query value" }; rule method { token ,"method" }; - rule path { slash >> raw[*(char_ - query_illegal)] ,"path" }; + rule path { -slash >> raw[*(char_ - query_illegal)] ,"path" }; rule fragment { pound >> -token ,"fragment" }; rule version { token ,"version" }; @@ -177,7 +177,7 @@ struct grammar rule query_string { - question >> raw[(query_key >> -(equal >> query_val)) % ampersand] + question >> -raw[(query_key >> -(equal >> query_val)) % ampersand] ,"query string" };