Skip to content

Commit

Permalink
Disable check for Agent Headers as other tinfoil headers are sufficient
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmandourah committed Oct 18, 2024
1 parent 9d7b45a commit 5a68914
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions security.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ func (s *TinShop) TinfoilMiddleware(next http.Handler) http.Handler {
_ = shopTemplate.Execute(w, s.Shop.Config.ShopTemplateData())
return
}

// Disable check for Agent check as checking for other tinfoil headers are sufficient and with Hauth its kind of unnessecery

// No User-Agent for tinfoil app
if headers["User-Agent"] != nil {
log.Println("[Security] User-Agent detected...")
_ = shopTemplate.Execute(w, s.Shop.Config.ShopTemplateData())
return
}
// if headers["User-Agent"] != nil {
// log.Println("[Security] User-Agent detected...")
// _ = shopTemplate.Execute(w, s.Shop.Config.ShopTemplateData())
// return
// }

// Be sure all tinfoil headers are present
if headers["Theme"] == nil || headers["Uid"] == nil || headers["Version"] == nil || headers["Language"] == nil || headers["Hauth"] == nil || headers["Uauth"] == nil {
Expand Down

0 comments on commit 5a68914

Please sign in to comment.