Skip processing option (#590)

* Skip processing option

* Simplify SkipProcessingFormats iteration
This commit is contained in:
Svyatoslav Kryukov
2021-03-22 17:16:03 +03:00
committed by GitHub
parent b93aa2f144
commit c07222b501
6 changed files with 61 additions and 4 deletions

View File

@@ -184,12 +184,12 @@ func handleProcessing(reqID string, rw http.ResponseWriter, r *http.Request) {
checkTimeout(ctx)
if len(conf.SkipProcessingFormats) > 0 {
po := getProcessingOptions(ctx)
if len(po.SkipProcessingFormats) > 0 {
imgdata := getImageData(ctx)
po := getProcessingOptions(ctx)
if imgdata.Type == po.Format || po.Format == imageTypeUnknown {
for _, f := range conf.SkipProcessingFormats {
for _, f := range po.SkipProcessingFormats {
if f == imgdata.Type {
po.Format = imgdata.Type
respondWithImage(ctx, reqID, r, rw, imgdata.Data)