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

Method StatusFor

fetch_test.go:88–102  ·  view source on GitHub ↗
(rawurl string)

Source from the content-addressed store, hash-verified

86}
87
88func (sh *spyHandler) StatusFor(rawurl string) int {
89 sh.mu.Lock()
90 defer sh.mu.Unlock()
91 ix := -1
92 for i, c := range sh.cmds {
93 if c.URL().String() == rawurl {
94 ix = i
95 break
96 }
97 }
98 if ix >= 0 && sh.res[ix] != nil {
99 return sh.res[ix].StatusCode
100 }
101 return -1
102}
103
104func (sh *spyHandler) BodyFor(rawurl string) string {
105 sh.mu.Lock()

Callers 2

TestBasicAuthFunction · 0.95
TestFullCmdFunction · 0.95

Calls 1

URLMethod · 0.65

Tested by

no test coverage detected