HeaderBag apply ([ ?HttpAdapter $http = new GlobalHttpAdapter ] )
Calling this function will initiate the following
- Existing headers from the HttpAdapter's source will be imported into SecureHeaders' internal list, parsed
- Automatic header functions will be applied
- CSP, HSTS, and HPKP policies will be compiled and added to SecureHeaders' internal header list
- Headers queued for removal will be deleted from SecureHeaders' internal header list
- Safe Mode will examine the list of headers, and make any required changes according to its settings
- The HttpAdapter will be instructed to remove all headers from its header source, Headers will then be copied from SecureHeaders' internal header list, into the HttpAdapter's (now empty) list of headers
- If error reporting is enabled (both within
SecureHeaders and according to the PHP configuration values for
error reporting, and whether to display errors)
- Missing security headers will be reported as
E_USER_WARNING
- Misconfigured headers will be reported as
E_USER_WARNING
orE_USER_NOTICE
depending on severity, the former being most severe an issue.
- Missing security headers will be reported as
Note: Calling this function is required before the first byte
of output in order for SecureHeaders to (be able to) do anything. If
you're not sure when the first byte of output might occur, or simply
don't want to have to call this every time – take a look at
->applyOnOutput
to have SecureHeaders take care of this for you.
An implementation of the ->HttpAdapter
interface, to which
settings configured via SecureHeaders will be applied.
Returns the headers
strong emph strong in emph emph in strong in strong emph in emph strong
emph with emph in it strong with strong in it
internal emphasis: foobarbaz no emphasis: foo_bar_baz
- a
- b
- c
- d
- e
- f
- g
- h
- i
bar baz foo
foo
a
foo bar
foo bar baz
code
not code
- one
two
foo
foo
bar
asdf
sdfg
asdf sdfg
- a
- b
- a
- b
- a
- b
Stefan said:
I would like to visit a castle in north scotland, next year. But my home is my castle
[Stefan said]:
I would like to visit a castle in north scotland, next year. But my home is my castle
[Stefan said][2pm Sunday]:
I would like to visit a castle in north scotland, next year. But my home is my castle
abc | defghi |
---|---|
bar | baz |
www.google.com http://www.google.com http://www.google.com
strong with emph* in it
*normal strong in it
strong still strong*
two del one del ~~~three del~~~ ~~del ~with del~~~
==two mark== =one mark= ===three mark=== ==mark =with mark=== ===with mark= mark==
bar
baz
foo
abc a b*d
c abc a b*d
c
a abc
a a_
a
a b*c c
a a
ὐ a
foo bar *baz bim bam
foo***
foo* bar
foo bar
foo bar
foobar
foobarbaz
***foo1234567890
_foo
strong emph
strong in emph
in emph strong
emph with emph in it strong with strong in it
in strong emph
emph in strong
foobarbaz
a *
a