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

Method applyURLOptions

options/parser/processing_options.go:123–143  ·  view source on GitHub ↗
(
	ctx context.Context,
	o *options.Options,
	options []urlOption,
	allowAll bool,
	usedPresets ...string,
)

Source from the content-addressed store, hash-verified

121}
122
123func (p *Parser) applyURLOptions(
124 ctx context.Context,
125 o *options.Options,
126 options []urlOption,
127 allowAll bool,
128 usedPresets ...string,
129) error {
130 allowAll = allowAll || len(p.config.AllowedProcessingOptions) == 0
131
132 for _, opt := range options {
133 if !allowAll && !slices.Contains(p.config.AllowedProcessingOptions, opt.Name) {
134 return newForbiddenOptionError(ctx, "processing", opt.Name)
135 }
136
137 if err := p.applyURLOption(ctx, o, opt.Name, opt.Args, usedPresets...); err != nil {
138 return err
139 }
140 }
141
142 return nil
143}
144
145func (p *Parser) defaultProcessingOptions(
146 ctx context.Context,

Callers 3

applyPresetOptionMethod · 0.95
parsePathOptionsMethod · 0.95
validatePresetsMethod · 0.95

Calls 2

applyURLOptionMethod · 0.95
newForbiddenOptionErrorFunction · 0.85

Tested by

no test coverage detected