MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / execute

Method execute

handlers/stream/handler_test.go:148–164  ·  view source on GitHub ↗
(
	imageURL string,
	header http.Header,
	o *options.Options,
)

Source from the content-addressed store, hash-verified

146}
147
148func (s *HandlerTestSuite) execute(
149 imageURL string,
150 header http.Header,
151 o *options.Options,
152) *http.Response {
153 imageURL = s.testServer().URL() + imageURL
154 req := httptest.NewRequest(http.MethodGet, "/", nil).WithContext(s.T().Context())
155 httpheaders.CopyAll(header, req.Header, true)
156
157 rw := httptest.NewRecorder()
158 rww := s.rwFactory().NewWriter(rw)
159
160 err := s.handler().Execute(req, imageURL, "test-req-id", o, rww)
161 s.Require().Nil(err)
162
163 return rw.Result()
164}
165
166// TestHandlerBasicRequest checks basic streaming request
167func (s *HandlerTestSuite) TestHandlerBasicRequest() {

Calls 7

CopyAllFunction · 0.92
NewRequestMethod · 0.80
TMethod · 0.80
NewWriterMethod · 0.80
handlerMethod · 0.80
URLMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected