Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces
csp.h File Reference
#include <memory>
#include <string>
#include <vector>
#include "net/instaweb/rewriter/public/csp_directive.h"
#include "pagespeed/kernel/base/string.h"
#include "pagespeed/kernel/base/string_util.h"
#include "pagespeed/kernel/http/google_url.h"

Go to the source code of this file.


class  net_instaweb::CspSourceExpression
struct  net_instaweb::CspSourceExpression::UrlData
class  net_instaweb::CspSourceList
class  net_instaweb::CspPolicy
class  net_instaweb::CspContext


 Unit-test framework for wget fetcher.

Detailed Description

This provides basic parsing and evaluation of a (subset of) Content-Security-Policy that's relevant for PageSpeed Automatic. CspContext is the main class.

Limitations versus the full spec: 1) We don't fully parse some kinds of source expressions, like nonce and hash ones. 2) Only some of the directives are parsed. 3) URL matching doesn't support WebSocket (ws: and wss:) schemes, since mod_pagespeed doesn't, and they make for some really ugly conditionals.