Execute handles the image passthrough request, streaming the image directly to the response writer
( userRequest *http.Request, imageURL string, reqID string, o *options.Options, rw server.ResponseWriter, )
| 71 | |
| 72 | // Execute handles the image passthrough request, streaming the image directly to the response writer |
| 73 | func (s *Handler) Execute( |
| 74 | userRequest *http.Request, |
| 75 | imageURL string, |
| 76 | reqID string, |
| 77 | o *options.Options, |
| 78 | rw server.ResponseWriter, |
| 79 | ) *server.Error { |
| 80 | stream := &request{ |
| 81 | HandlerContext: s.HandlerContext, |
| 82 | handler: s, |
| 83 | imageRequest: userRequest, |
| 84 | imageURL: imageURL, |
| 85 | reqID: reqID, |
| 86 | opts: o, |
| 87 | rw: rw, |
| 88 | } |
| 89 | |
| 90 | return stream.execute() |
| 91 | } |
| 92 | |
| 93 | // execute handles the actual streaming logic |
| 94 | func (s *request) execute() *server.Error { |