This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM --platform=$BUILDPLATFORM golang:1.22.5-alpine AS base | |
| WORKDIR /src | |
| ENV CGO_ENABLED=0 | |
| COPY go.* . | |
| RUN --mount=type=cache,target=/go/pkg/mod \ | |
| go mod download | |
| FROM base AS builder-linux-amd64 | |
| RUN --mount=target=. \ | |
| --mount=type=cache,target=/go/pkg/mod \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "errors" | |
| "fmt" | |
| "log/slog" | |
| "net/http" | |
| "net/http/httputil" | |
| "os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let isWebpSupportedInstance = null; | |
| const isWebpSupported = async (): Promise<boolean> => { | |
| if (isWebpSupportedInstance !== null) { | |
| return isWebpSupportedInstance; | |
| } | |
| if(checkWebpDecoding){ | |
| isWebpSupportedInstance = true; | |
| } else if (await checkWebpLossySupport()){ |