12345678module juptune.http.v1;
bool http1IsPathValidForMethod(
const const char[] method,
const const char[] path,
Uri uri,
bool isProxyRequest = false
);
ditto.
1234567module juptune.http.v1;
bool http1IsPathValidForMethod(
const const char[] method,
UriParseHints hints,
bool isProxyRequest = false
);
ditto
1234567module juptune.http.v1;
bool http1IsPathValidForMethod(
const const char[] method,
const const char[] path,
bool isProxyRequest = false
);
Checks whether the given path is valid for the given method, taking into account whether the request is being proxied or not.
HttpWriter and HttpReader already perform path validation, however keeping this logic private doesn't provide much benefit, so it's been made public.
This check should match the speficiation of Section 3.2 in RFC9112.
The overload that takes a UriParseHintsis provided for performance reasons, as it allows the caller to avoid parsing the path twice. It is unable to handle OPTIONS *however as '*' is not a valid RFC 3986 URI so a trivial check must be manually performed beforehand.
Additionally another overload is provided that returns the parsed URI with hints, as it is likely that the caller will need to parse the URI anyway.
trueif the path is valid for the given method, falseotherwise.