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)
| 230 | // defined by the masterQuery, and hence if the client is allowed to get that |
| 231 | // response. |
| 232 | func (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. |
| 244 | func randListen(listenAddr string) (string, error) { |
no test coverage detected