MCPcopy Index your code
hub / github.com/perkeep/perkeep / allowProxySearchResponse

Method allowProxySearchResponse

pkg/server/app/app.go:232–241  ·  view source on GitHub ↗

allowProxySearchResponse checks whether the blobs in sr are within the domain defined by the masterQuery, and hence if the client is allowed to get that response.

(sr *search.SearchResult)

Source from the content-addressed store, hash-verified

230// defined by the masterQuery, and hence if the client is allowed to get that
231// response.
232func (a *Handler) allowProxySearchResponse(sr *search.SearchResult) bool {
233 a.masterQueryMu.RLock()
234 defer a.masterQueryMu.RUnlock()
235 for _, v := range sr.Blobs {
236 if _, ok := a.domainBlobs[v.Blob]; !ok {
237 return false
238 }
239 }
240 return true
241}
242
243// randListen returns the concatenation of the host part of listenAddr with a random port.
244func randListen(listenAddr string) (string, error) {

Callers 1

handleSearchMethod · 0.95

Calls 2

RLockMethod · 0.65
RUnlockMethod · 0.65

Tested by

no test coverage detected