Page Speed Optimization Libraries
1.11.33.2
|
#include "domain_rewrite_filter.h"
Public Member Functions | |
DomainRewriteFilter (RewriteDriver *rewrite_driver, Statistics *stats) | |
virtual void | StartDocumentImpl () |
virtual void | EndDocument () |
virtual void | StartElementImpl (HtmlElement *element) |
virtual void | EndElementImpl (HtmlElement *element) |
virtual const char * | Name () const |
ScriptUsage | GetScriptUsage () const override |
![]() | |
CommonFilter (RewriteDriver *driver) | |
const GoogleUrl & | base_url () const |
Getters. More... | |
const GoogleUrl & | decoded_base_url () const |
RewriteDriver * | driver () const |
HtmlElement * | noscript_element () const |
void | InsertNodeAtBodyEnd (HtmlNode *data) |
virtual void | StartDocument () |
Note: Don't overload these methods, overload the implementers instead! | |
virtual void | StartElement (HtmlElement *element) |
virtual void | EndElement (HtmlElement *element) |
virtual void | Characters (HtmlCharactersNode *characters) |
ResourcePtr | CreateInputResource (StringPiece input_url, bool *is_authorized) |
ResourcePtr | CreateInputResourceOrInsertDebugComment (StringPiece input_url, HtmlElement *element) |
void | ResolveUrl (StringPiece input_url, GoogleUrl *out_url) |
bool | BaseUrlIsValid () const |
bool | DebugMode () const |
bool | CanAddPagespeedOnloadToImage (const HtmlElement &) |
virtual void | LogFilterModifiedContent () |
virtual RewriteDriver::InlineAuthorizationPolicy | AllowUnauthorizedDomain () const |
virtual bool | IntendedForInlining () const |
void | AddJsToElement (StringPiece js, HtmlElement *script) |
Static Public Member Functions | |
static void | InitStats (Statistics *statistics) |
static RewriteResult | Rewrite (const StringPiece &input_url, const GoogleUrl &base_url, const ServerContext *server_context, const RewriteOptions *options, bool apply_sharding, bool apply_domain_suffix, GoogleString *output_url) |
static void | UpdateDomainHeaders (const GoogleUrl &base_url, const ServerContext *server_context, const RewriteOptions *options, ResponseHeaders *headers) |
static bool | UpdateOneDomainHeader (HeaderSource src, const GoogleUrl &base_url, const ServerContext *server_context, const RewriteOptions *options, StringPiece name, StringPiece value_in, GoogleString *out) |
static bool | UpdateSetCookieHeader (const GoogleUrl &base_url, const ServerContext *server_context, const RewriteOptions *options, StringPiece value_in, GoogleString *out) |
Like UpdateOneDomainHeader, but specifically for Set-Cookie. | |
static bool | ParseRefreshContent (StringPiece input, StringPiece *before, StringPiece *url, StringPiece *after) |
static void | ParseSetCookieAttributes (StringPiece input, StringPiece *cookie_string, SetCookieAttributes *attributes) |
![]() | |
static bool | ExtractMetaTagDetails (const HtmlElement &element, const ResponseHeaders *headers, GoogleString *content, GoogleString *mime_type, GoogleString *charset) |
Static Public Attributes | |
static const char | kStickyRedirectHeader [] |
![]() | |
static const char | kCreateResourceFailedDebugMsg [] |
Debug message to be inserted when resource creation fails. | |
Additional Inherited Members | |
![]() | |
ServerContext * | server_context () const |
const RewriteOptions * | rewrite_options () |
virtual const char * | LoggingId () |
Filter that rewrites URL domains for resources that are not otherwise rewritten. For example, the user may want to domain-shard adding a hash to their URL leaves, or domain shard resources that are not cacheable.
This will also rewrite hyperlinks and URL-related headers and metas if domain_rewrite_hyperlinks() is on, and also to Set-Cookie headers if domain_rewrite_cookies() is on.
|
inlineoverride |
Injects scripts only when option ClientDomainRewrite is true, and the current document is not AMP.
|
static |
Tries to parse the content of a Refresh header, returning if successful. *before gets anything before the URL or its opening quotes. *url gets the portion of parse that's the URL itself, and *after gets everything after the URL and its closing quote, if any. Note that this means that reassembling the URL may require addition of new quotes and escaping.
|
static |
Tries to parse the contents of a Set-Cookie header, specified as "input", extracting out the cookie string into *cookie_string and the attribute key value pairs into *attributes. This does not eliminate duplicate attributes; note that the spec requires using the last occurrences. *attributes and *cookie_string are overwritten, not appended to.
|
static |
Rewrites the specified URL (which might be relative to the base tag) into an absolute sharded url.
Absolute URL output_url will be set if kRewroteDomain or kDomainUnchanged returned.
static for use in UpdateLocationHeader.
|
virtual |
Overload these implementer methods: Intentionally left abstract so that implementers don't forget to change the name from Blah to BlahImpl.
Implements net_instaweb::CommonFilter.
|
static |
Update url and domains in headers as per the rewrite rules configured for this domain.
For now this fixes Location:, Refresh:, and Set-Cookie:
static since we may need to do it in Apache with no appropriate RewriteDriver available.
|
static |
Update an indivual header based on domain rewrite rules. Returns true if a change was made, in which case *out should be committed.