Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Go Httpbin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Nix
Go Httpbin
Commits
73a9e81f
Commit
73a9e81f
authored
7 years ago
by
Will McCutchen
Browse files
Options
Downloads
Patches
Plain Diff
Allow github banner image in CSP
parent
55968280
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
httpbin/handlers.go
+1
-1
1 addition, 1 deletion
httpbin/handlers.go
httpbin/handlers_test.go
+1
-1
1 addition, 1 deletion
httpbin/handlers_test.go
with
2 additions
and
2 deletions
httpbin/handlers.go
+
1
−
1
View file @
73a9e81f
...
...
@@ -34,7 +34,7 @@ func (h *HTTPBin) Index(w http.ResponseWriter, r *http.Request) {
http
.
Error
(
w
,
"Not Found"
,
http
.
StatusNotFound
)
return
}
w
.
Header
()
.
Set
(
"Content-Security-Policy"
,
"default-src 'self'; style-src 'unsafe-inline'"
)
w
.
Header
()
.
Set
(
"Content-Security-Policy"
,
"default-src 'self'; style-src
'self'
'unsafe-inline'
; img-src 'self' camo.githubusercontent.com
"
)
writeHTML
(
w
,
assets
.
MustAsset
(
"index.html"
),
http
.
StatusOK
)
}
...
...
This diff is collapsed.
Click to expand it.
httpbin/handlers_test.go
+
1
−
1
View file @
73a9e81f
...
...
@@ -64,7 +64,7 @@ func TestIndex(t *testing.T) {
handler
.
ServeHTTP
(
w
,
r
)
assertContentType
(
t
,
w
,
htmlContentType
)
assertHeader
(
t
,
w
,
"Content-Security-Policy"
,
"default-src 'self'; style-src 'unsafe-inline'"
)
assertHeader
(
t
,
w
,
"Content-Security-Policy"
,
"default-src 'self'; style-src
'self'
'unsafe-inline'
; img-src 'self' camo.githubusercontent.com
"
)
assertBodyContains
(
t
,
w
,
"go-httpbin"
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment