MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / ProcessHeader

Function ProcessHeader

internal/net/serve.go:213–227  ·  view source on GitHub ↗
(origin, override http.Header)

Source from the content-addressed store, hash-verified

211 return nil
212}
213func ProcessHeader(origin, override http.Header) http.Header {
214 result := http.Header{}
215 // client header
216 for h, val := range origin {
217 if utils.SliceContains(conf.SlicesMap[conf.ProxyIgnoreHeaders], strings.ToLower(h)) {
218 continue
219 }
220 result[h] = val
221 }
222 // needed header
223 for h, val := range override {
224 result[h] = val
225 }
226 return result
227}
228
229// RequestHttp deal with Header properly then send the request
230func RequestHttp(ctx context.Context, httpMethod string, headerOverride http.Header, URL string) (*http.Response, error) {

Callers 2

GetRangeReaderFromLinkFunction · 0.92
ProxyFunction · 0.92

Calls 1

SliceContainsFunction · 0.92

Tested by

no test coverage detected