def _mangled_realm(self, realm): uri_parts = _urisplit(realm) if uri_parts.scheme: new_uri_parts = ('{}+memcache'.format(uri_parts.scheme),) \ + uri_parts[1:] return _uriunsplit(new_uri_parts) else: return realm
def _unmangled_realm(self, realm): uri_parts = _urisplit(realm) if uri_parts.scheme \ and uri_parts.scheme\ .endswith(self._MANGLED_REALM_SCHEME_SUFFIX): new_uri_parts = \ (uri_parts.scheme[:-len(self._MANGLED_REALM_SCHEME_SUFFIX)],) \ + uri_parts[1:] return _uriunsplit(new_uri_parts) else: return realm
def request_cors_request_type(self): if self._request_cors_request_type is None: if self.request_origin is None: pass elif self.request_webmethod.name == 'options' \ and 'Access-Control-Request-Method' \ in self.request.headers: self._request_cors_request_type = \ _cors.CorsRequestType('preflight') else: request_origin_parts = _urisplit(self.request_origin) if not (request_origin_parts.scheme == self.request.protocol and request_origin_parts.netloc == self.request.host): self._request_cors_request_type = \ _cors.CorsRequestType('actual') return self._request_cors_request_type