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

Method preprocessURL

options/parser/url.go:13–23  ·  view source on GitHub ↗
(u string)

Source from the content-addressed store, hash-verified

11const urlTokenPlain = "plain"
12
13func (p *Parser) preprocessURL(u string) string {
14 for _, repl := range p.config.URLReplacements {
15 u = repl.Regexp.ReplaceAllString(u, repl.Replacement)
16 }
17
18 if len(p.config.BaseURL) == 0 || strings.HasPrefix(u, p.config.BaseURL) {
19 return u
20 }
21
22 return fmt.Sprintf("%s%s", p.config.BaseURL, u)
23}
24
25func (p *Parser) decodeBase64URL(ctx context.Context, parts []string) (string, string, error) {
26 var format string

Callers 2

decodeBase64URLMethod · 0.95
decodePlainURLMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected