void userInfo(const SBuf &s) {userInfo_=s;}
const SBuf &userInfo() const {return userInfo_;}
+ /// the static '*' pseudo-URL
+ static const SBuf &Asterisk();
+
private:
/**
\par
"[:]"
;
+const SBuf &
+URL::Asterisk()
+{
+ static SBuf star("*");
+ return star;
+}
+
void
urlInitialize(void)
{
return NULL;
} else if ((method == Http::METHOD_OPTIONS || method == Http::METHOD_TRACE) &&
- strcmp(url, "*") == 0) {
+ URL::Asterisk().cmp(url) == 0) {
protocol = AnyP::PROTO_HTTP;
port = urlDefaultPort(protocol);
return urlParseFinish(method, protocol, url, host, SBuf(), port, request);
// we support OPTIONS and TRACE directed at us (with a 501 reply, for now)
// we also support forwarding OPTIONS and TRACE, except for the *-URI ones
if (r->method == Http::METHOD_OPTIONS || r->method == Http::METHOD_TRACE)
- return (r->header.getInt64(HDR_MAX_FORWARDS) == 0 || r->urlpath != "*");
+ return (r->header.getInt64(HDR_MAX_FORWARDS) == 0 || URL::Asterisk().cmp(r->urlpath.rawBuf(), r->urlpath.size()) != 0);
if (r->method == Http::METHOD_PURGE)
return 1;