updated comments and added CSP header check in the tests

This commit is contained in:
Gani Georgiev 2022-07-21 17:22:31 +03:00
parent 4c2cd5a534
commit 7926501649
1 changed files with 13 additions and 11 deletions

View File

@ -177,21 +177,22 @@ func TestFileSystemServe(t *testing.T) {
"test_name.txt", "test_name.txt",
false, false,
map[string]string{ map[string]string{
"Content-Disposition": "attachment; filename=test_name.txt", "Content-Disposition": "attachment; filename=test_name.txt",
"Content-Type": "application/octet-stream", "Content-Type": "application/octet-stream",
"Content-Length": "0", "Content-Length": "0",
"Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
}, },
}, },
// png inline
{ {
// svg exception // png inline
"image.png", "image.png",
"test_name.png", "test_name.png",
false, false,
map[string]string{ map[string]string{
"Content-Disposition": "inline; filename=test_name.png", "Content-Disposition": "inline; filename=test_name.png",
"Content-Type": "image/png", "Content-Type": "image/png",
"Content-Length": "73", "Content-Length": "73",
"Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
}, },
}, },
{ {
@ -200,9 +201,10 @@ func TestFileSystemServe(t *testing.T) {
"test_name.svg", "test_name.svg",
false, false,
map[string]string{ map[string]string{
"Content-Disposition": "attachment; filename=test_name.svg", "Content-Disposition": "attachment; filename=test_name.svg",
"Content-Type": "image/svg+xml", "Content-Type": "image/svg+xml",
"Content-Length": "0", "Content-Length": "0",
"Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
}, },
}, },
} }