mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(api): block empty user-agents
This commit is contained in:
parent
95389e8df8
commit
5da3c84bce
1 changed files with 6 additions and 0 deletions
|
|
@ -48,6 +48,12 @@ func init() {
|
|||
type ProxyHandler struct{}
|
||||
|
||||
func (p ProxyHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||
if r.Header.Get("User-Agent") == "" {
|
||||
// please set a valid user-agent
|
||||
rw.WriteHeader(403)
|
||||
return
|
||||
}
|
||||
|
||||
remote, ok := remotes[r.Host]
|
||||
if !ok {
|
||||
// unknown domains redirect to landing page
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue