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

Method applyFilenameOption

options/parser/apply.go:434–448  ·  view source on GitHub ↗
(ctx context.Context, o *options.Options, args []string)

Source from the content-addressed store, hash-verified

432}
433
434func (p *Parser) applyFilenameOption(ctx context.Context, o *options.Options, args []string) error {
435 if err := p.ensureMaxArgs(ctx, keys.Filename, args, 2); err != nil {
436 return err
437 }
438
439 if len(args) > 1 && len(args[1]) > 0 {
440 if encoded, _ := strconv.ParseBool(args[1]); encoded {
441 return p.parseBase64String(ctx, o, keys.Filename, args[0])
442 }
443 }
444
445 o.Set(keys.Filename, args[0])
446
447 return nil
448}
449
450func (p *Parser) applyExpiresOption(ctx context.Context, o *options.Options, args []string) error {
451 if err := p.ensureMaxArgs(ctx, keys.Expires, args, 1); err != nil {

Callers 1

applyURLOptionMethod · 0.95

Calls 3

ensureMaxArgsMethod · 0.95
parseBase64StringMethod · 0.95
SetMethod · 0.45

Tested by

no test coverage detected