Skip to content

Commit

Permalink
feat: support response webp (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored Dec 21, 2024
1 parent edd91c8 commit 39a024b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ func (h Handle) processImage(c echo.Context, upstream *url.URL, p string, size S
"field": {"file"},
}

if path.Ext(path.Base(p)) == ".jpg" {
switch path.Ext(path.Base(p)) {
case ".jpg":
qs.Set("type", "jpeg")
case ".webp":
qs.Set("type", "webp")
}

upstreamUrl := upstream.String() + "/" + action + "?" + qs.Encode()
Expand Down

0 comments on commit 39a024b

Please sign in to comment.