reject origin test in getjunk path to catch strays

This commit is contained in:
Ted Unangst 2023-08-05 20:52:55 -04:00
parent ef8b188fa9
commit 6a5f4ba621
1 changed files with 3 additions and 0 deletions

View File

@ -133,6 +133,9 @@ var flightdeck = gate.NewSerializer()
var signGets = true var signGets = true
func GetJunkTimeout(userid int64, url string, timeout time.Duration) (junk.Junk, error) { func GetJunkTimeout(userid int64, url string, timeout time.Duration) (junk.Junk, error) {
if rejectorigin(userid, url, false) {
return nil, fmt.Errorf("rejected origin: %s", url)
}
client := http.DefaultClient client := http.DefaultClient
sign := func(req *http.Request) error { sign := func(req *http.Request) error {
var ki *KeyInfo var ki *KeyInfo