MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / newSourceURLError

Function newSourceURLError

security/errors.go:52–61  ·  view source on GitHub ↗
(imageURL string)

Source from the content-addressed store, hash-verified

50}
51
52func newSourceURLError(imageURL string) error {
53 return SourceURLError{errctx.NewTextError(
54 fmt.Sprintf("Source URL is not allowed: %s", imageURL),
55 1,
56 errctx.WithStatusCode(http.StatusNotFound),
57 errctx.WithPublicMessage("Invalid source URL"),
58 errctx.WithShouldReport(false),
59 errctx.WithDocsURL("https://docs.imgproxy.net/configuration/options#IMGPROXY_ALLOWED_SOURCES"),
60 )}
61}

Callers 1

VerifySourceURLMethod · 0.85

Calls 5

NewTextErrorFunction · 0.92
WithStatusCodeFunction · 0.92
WithPublicMessageFunction · 0.92
WithShouldReportFunction · 0.92
WithDocsURLFunction · 0.92

Tested by

no test coverage detected