src/lib/url/url_canon_relative.cc
// Firefox does a case-sensitive compare (which is probably wrong--Mozilla bug
// 379034), whereas IE is case-insensitive.
//
// We choose to be more permissive like IE. We don't need to worry about
// unescaping or anything here: neither IE or Firefox allow this. We also
// don't have to worry about invalid scheme characters since we are comparing
// against the canonical scheme of the base.
//
// The base URL should always be canonical, therefore it should be ASCII.
Firefox does a case-sensitive compare (which is probably wrong--Mozilla bug
379034), whereas IE is case-insensitive.

We choose to be more permissive like IE. We don't need to worry about
unescaping or anything here: neither IE or Firefox allow this. We also
don't have to worry about invalid scheme characters since we are comparing
against the canonical scheme of the base.

The base URL should always be canonical, therefore it should be ASCII.
Firefox does a case - sensitive compare ( which is probably wrong -- Mozilla bug 379034 ) whereas IE is case - insensitive . We choose to be more permissive like IE . We don ' t need to worry about unescaping or anything here : neither IE or Firefox allow this . We also don ' t have to worry about invalid scheme characters since we are comparing against the canonical scheme of the base . The base URL should always be canonical therefore it should be ASCII .
bool AreSchemesEqual(const char* base, const Component& base_scheme, const char* cmp,
                     const Component& cmp_scheme) {
  if (base_scheme.len() != cmp_scheme.len())
    return false;
  for (size_t i = 0; i < base_scheme.len(); i++) {
    if (CanonicalSchemeChar(cmp[cmp_scheme.begin + i]) != base[base_scheme.begin + i])
      return false;
  }
  return true;
}
bool AreSchemesEqual ( const char * base , const Component & base_scheme , const char * cmp , const Component & cmp_scheme ) { if ( base_scheme . len ( ) != cmp_scheme . len ( ) ) return false ; for ( size_t i = 0 ; i < base_scheme . len ( ) ; i ++ ) { if ( CanonicalSchemeChar ( cmp [ cmp_scheme . begin + i ] ) != base [ base_scheme . begin + i ] ) return false ; } return true ; }
Firefox does a case-sensitive compare (which is probably wrong--Mozilla bug
379034), whereas IE is case-insensitive.
Firefox does a case - sensitive compare ( which is probably wrong -- Mozilla bug 379034 ) whereas IE is case - insensitive .
// We assume the base is already canonical, so we don't have to // canonicalize it.