Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nicolas PERNOUD
Vestibule
Commits
91f7875d
Commit
91f7875d
authored
Jun 28, 2021
by
Nicolas Pernoud
Browse files
chore: corrected some linter revealed code smells
parent
e2554e11
Pipeline
#14706
passed with stages
in 2 minutes and 54 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pkg/cache/cache_test.go
View file @
91f7875d
...
...
@@ -272,7 +272,7 @@ func TestResponseToBytes(t *testing.T) {
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
b
:=
tt
.
response
.
Bytes
()
if
b
==
nil
||
len
(
b
)
==
0
{
if
len
(
b
)
==
0
{
t
.
Error
(
"Bytes() failed to convert"
)
return
}
...
...
pkg/middlewares/middlewares.go
View file @
91f7875d
...
...
@@ -58,7 +58,7 @@ type webSecurityWriter struct {
}
func
(
s
webSecurityWriter
)
WriteHeader
(
code
int
)
{
if
s
.
wroteHeader
==
false
{
if
!
s
.
wroteHeader
{
s
.
w
.
Header
()
.
Set
(
"Strict-Transport-Security"
,
"max-age=63072000"
)
var
inline
string
if
s
.
allowEvalInlineScript
{
...
...
@@ -81,6 +81,7 @@ func (s webSecurityWriter) WriteHeader(code int) {
s
.
w
.
Header
()
.
Set
(
"X-XSS-Protection"
,
"1; mode=block"
)
s
.
w
.
Header
()
.
Set
(
"Referrer-Policy"
,
"strict-origin"
)
s
.
w
.
Header
()
.
Set
(
"X-Content-Type-Options"
,
"nosniff"
)
//lint:ignore SA4005 we need to assign true so that when the WriteHeader method will be used again, we won't rewrite security headers
s
.
wroteHeader
=
true
}
s
.
w
.
WriteHeader
(
code
)
...
...
web/index.html
View file @
91f7875d
...
...
@@ -32,7 +32,7 @@
<div
class=
"navbar-brand"
>
<div
class=
"navbar-item"
>
<a
class=
"button is-primary is-rounded is-outlined"
href=
"https://www.github.com/nicolaspernoud/Vestibule"
target=
"_blank"
rel=
"noopener noreferrer"
>
<span>
4.5.1
5
</span>
<span>
4.5.1
6
</span>
<span
class=
"icon"
>
<svg
class=
"svg-inline--fa fa-github fa-w-16"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment