URL.h File Reference
#include "anyp/UriScheme.h"
#include "ip/Address.h"
#include "rfc2181.h"
#include "sbuf/SBuf.h"
#include <iosfwd>
Include dependency graph for URL.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  URL


enum  MatchDomainNameFlags {
  mdnNone = 0,
  mdnHonorWildcards = 1 << 0,
  mdnRejectSubsubDomains = 1 << 1


std::ostream & operator<< (std::ostream &os, const URL &url)
void urlInitialize (void)
char * urlCanonicalClean (const HttpRequest *)
const char * urlCanonicalFakeHttps (const HttpRequest *request)
bool urlIsRelative (const char *)
char * urlMakeAbsolute (const HttpRequest *, const char *)
char * urlRInternal (const char *host, unsigned short port, const char *dir, const char *name)
char * urlInternal (const char *dir, const char *name)
int matchDomainName (const char *host, const char *domain, uint flags=mdnNone)
int urlCheckRequest (const HttpRequest *)
char * urlHostname (const char *url)
void urlExtMethodConfigure (void)

Enumeration Type Documentation


Definition at line 180 of file URL.h.

Function Documentation

int matchDomainName ( const char *  host,
const char *  domain,
uint  flags = mdnNone 

matchDomainName() matches a hostname (usually extracted from traffic) with a domainname when mdnNone or mdnRejectSubsubDomains flags are used according to the following rules:

HOST DOMAIN mdnNone mdnRejectSubsubDomains
foo.com foo.com YES YES
.foo.com foo.com YES YES
x.foo.com foo.com NO NO
foo.com .foo.com YES YES
.foo.com .foo.com YES YES
x.foo.com .foo.com YES YES
.x.foo.com .foo.com YES NO
y.x.foo.com .foo.com YES NO

if mdnHonorWildcards flag is set then the matchDomainName() also accepts optional wildcards on hostname:

*.foo.com x.foo.com YES
*.foo.com .x.foo.com YES
*.foo.com .foo.com YES
*.foo.com foo.com NO

The combination of mdnHonorWildcards and mdnRejectSubsubDomains flags is supported.

Return values
0means the host matches the domain
1means the host is greater than the domain
-1means the host is less than the domain

Definition at line 660 of file url.cc.

References mdnHonorWildcards, mdnRejectSubsubDomains, and xtolower.

Referenced by aclHostDomainCompare(), check_domain(), ClientRequestContext::hostHeaderVerify(), neighborType(), and urlInitialize().

std::ostream& operator<< ( std::ostream &  os,
const URL url 
char* urlCanonicalClean ( const HttpRequest request)
const char* urlCanonicalFakeHttps ( const HttpRequest request)

Yet another alternative to urlCanonical. This one adds the https:// parts to Http::METHOD_CONNECT URL for use in error page outputs. Luckily we can leverage the others instead of duplicating.

Definition at line 547 of file url.cc.

References buf, URL::host(), LOCAL_ARRAY, MAX_URL, HttpRequest::method, Http::METHOD_CONNECT, URL::port(), HttpRequest::url, and urlCanonicalClean().

Referenced by ErrorState::Convert().

void urlExtMethodConfigure ( void  )
char* urlHostname ( const char *  url)

Definition at line 858 of file url.cc.

References URLHostName::extract().

Referenced by htcpTstReply(), and urnParseReply().

void urlInitialize ( void  )
char* urlInternal ( const char *  dir,
const char *  name 
bool urlIsRelative ( const char *  )

Definition at line 568 of file url.cc.

References NULL, and p.

Referenced by purgeEntriesByHeader().

char* urlRInternal ( const char *  host,
unsigned short  port,
const char *  dir,
const char *  name 






Web Site Translations