MCPcopy Create free account
hub / github.com/PuerkitoBio/fetchbot / StatusRange

Method StatusRange

handler.go:222–231  ·  view source on GitHub ↗

StatusRange sets a criteria based on the Status code of the response for the Response Handler. Its Handler will only be called if the response has a status code between the min and max. If min is greater than max, the values are switched.

(min, max int)

Source from the content-addressed store, hash-verified

220// Its Handler will only be called if the response has a status code between the min and max.
221// If min is greater than max, the values are switched.
222func (r *ResponseMatcher) StatusRange(min, max int) *ResponseMatcher {
223 if min > max {
224 min, max = max, min
225 }
226 r.mux.mu.Lock()
227 defer r.mux.mu.Unlock()
228 r.minStatus = min
229 r.maxStatus = max
230 return r
231}
232
233// Scheme sets a criteria based on the scheme of the URL for the Response Handler. Its Handler
234// will only be called if the scheme of the URL matches exactly the specified scheme.

Callers 1

TestMuxFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestMuxFunction · 0.64