mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-22 07:44:48 -07:00
Refactor more, add scrape tests
This commit is contained in:
@@ -281,11 +281,11 @@ func NewScrape(cfg *config.Config, r *http.Request, p httprouter.Params) (*Scrap
|
||||
}
|
||||
|
||||
if q.Infohashes == nil {
|
||||
if _, exists := q.Params["infohash"]; !exists {
|
||||
if _, exists := q.Params["info_hash"]; !exists {
|
||||
// There aren't any infohashes.
|
||||
return nil, ErrMalformedRequest
|
||||
}
|
||||
q.Infohashes = []string{q.Params["infohash"]}
|
||||
q.Infohashes = []string{q.Params["info_hash"]}
|
||||
}
|
||||
|
||||
return &Scrape{
|
||||
|
||||
Reference in New Issue
Block a user