mirror of
https://codeberg.org/VnPower/PixivFE
synced 2024-12-06 19:16:23 +01:00
c9f3884f92
can't shake the fakey feeling. net/http expects one handler max. the way we currently detect redirect param is not one handler.
we should refactor the code out to be called from different handlers
also, wtf is /settings/novelFontType?noredirect=t&r= (redirect or no redirect?)
suggestion: Use Referer. the header exists for a reason. might need to turn off CSP for that.
517 B
517 B
Migrating from gofiber to net/http -- the plan
Tips
- To access
/:abc, user.PathValue("abc"). - Want to associate arbitrary value with a request? Use
r.Context.Value(). - Don't use
r.Response. It'snil.
todo
- correct redirect status codes. currently i put in whatever.
- 303 StatusSeeOther: set method to GET
- 307 Temporary: method and body not changed
- 308 Permanent: method and body not changed
- add limiter (maybe it should be in nginx)
- add caching (maybe it should be in nginx)