mirror of
https://github.com/ZizzyDizzyMC/linx-server.git
synced 2026-07-17 16:36:51 +00:00
Blank referrers are allowed
This commit is contained in:
parent
256ca43d69
commit
9b724725b3
3 changed files with 11 additions and 2 deletions
5
csrf.go
5
csrf.go
|
|
@ -24,6 +24,11 @@ func strictReferrerCheck(r *http.Request, prefix string, whitelistHeaders []stri
|
|||
}
|
||||
|
||||
referrer := r.Header.Get("Referer")
|
||||
|
||||
if referrer == "" {
|
||||
return true
|
||||
}
|
||||
|
||||
u, _ := url.Parse(referrer)
|
||||
return sameOrigin(u, p)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
400 Bad Request
|
||||
<div id="main">
|
||||
400 Bad Request
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
401 Unauthorized
|
||||
<div id="main">
|
||||
401 Unauthorized
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue