/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Utility class for handing back parsed directives and (optional) values class nsSecurityHeaderDirective
: public mozilla::LinkedListElement<nsSecurityHeaderDirective> { public: // The name of the directive.
nsCString mName; // The value of the directive, if any. Will be Some if and only if a '=' // followed the directive name (the value itself may be the empty string).
mozilla::Maybe<nsCString> mValue;
};
// This class parses security-related HTTP headers like // Strict-Transport-Security. The Augmented Backus-Naur Form syntax for this // header is reproduced below, for reference: // // Strict-Transport-Security = "Strict-Transport-Security" ":" // [ directive ] *( ";" [ directive ] ) // // directive = directive-name [ "=" directive-value ] // directive-name = token // directive-value = token | quoted-string // // where: // // token = <token, defined in [RFC2616], Section 2.2> // quoted-string = <quoted-string, defined in [RFC2616], Section 2.2>/ // // For further reference, see [RFC6797], Section 6.1
class nsSecurityHeaderParser { public: // The input to this class must be null-terminated, and must have a lifetime // greater than or equal to the lifetime of the created // nsSecurityHeaderParser. explicit nsSecurityHeaderParser(const nsCString& aHeader);
~nsSecurityHeaderParser();
// Only call Parse once.
nsresult Parse(); // The caller does not take ownership of the memory returned here.
mozilla::LinkedList<nsSecurityHeaderDirective>* GetDirectives();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.