Add a section to the config file for HTTP headers to add to responses

The example configuration files add X-Content-Type-Options: nosniff.

Add coverage in existing registry/handlers unit tests.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
Aaron Lehmann 2015-08-10 14:20:52 -07:00
parent 4f7cb60190
commit 9c3bed6b88
8 changed files with 68 additions and 1 deletions

View file

@ -17,6 +17,8 @@ http:
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
headers:
X-Content-Type-Options: [nosniff]
redis:
addr: localhost:6379
pool:

View file

@ -32,6 +32,8 @@ http:
addr: :5000
debug:
addr: localhost:5001
headers:
X-Content-Type-Options: [nosniff]
redis:
addr: localhost:6379
pool:

View file

@ -9,3 +9,5 @@ storage:
rootdirectory: /var/lib/registry
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]