Execute handles the image processing request
( reqID string, rw server.ResponseWriter, req *http.Request, )
| 65 | |
| 66 | // Execute handles the image processing request |
| 67 | func (h *Handler) Execute( |
| 68 | reqID string, |
| 69 | rw server.ResponseWriter, |
| 70 | req *http.Request, |
| 71 | ) *server.Error { |
| 72 | // Increment the number of requests in progress |
| 73 | h.Monitoring().Stats().IncRequestsInProgress() |
| 74 | defer h.Monitoring().Stats().DecRequestsInProgress() |
| 75 | |
| 76 | // Verify URL signature and extract image url and processing options |
| 77 | r, err := h.newRequest(req) |
| 78 | if err != nil { |
| 79 | return err |
| 80 | } |
| 81 | |
| 82 | // if processing options indicate raw image streaming, stream it and return |
| 83 | if r.opts.GetBool(keys.Raw, false) { |
| 84 | return h.stream.Execute(req, r.imageURL, reqID, r.opts, rw) |
| 85 | } |
| 86 | |
| 87 | r.reqID = reqID |
| 88 | r.req = req |
| 89 | r.rw = rw |
| 90 | r.config = h.config |
| 91 | r.ch = h.ConditionalHeaders().NewRequest(r.req) |
| 92 | |
| 93 | return r.execute() |
| 94 | } |
| 95 | |
| 96 | // newRequest extracts image url and processing options from request URL and verifies them |
| 97 | func (h *Handler) newRequest(req *http.Request) (*request, *server.Error) { |
nothing calls this directly
no test coverage detected