Commit 91f7875d authored by Nicolas Pernoud's avatar Nicolas Pernoud
Browse files

chore: corrected some linter revealed code smells

parent e2554e11
Pipeline #14706 passed with stages
in 2 minutes and 54 seconds
......@@ -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
}
......
......@@ -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)
......
......@@ -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.15</span>
<span>4.5.16</span>
<span class="icon">
<svg
class="svg-inline--fa fa-github fa-w-16"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment