mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-05 19:23:07 +02:00
Convert context value to string securely
This commit is contained in:
@@ -210,9 +210,11 @@ func getImageData(ctx context.Context) *imageData {
|
||||
}
|
||||
|
||||
func getCacheControlHeader(ctx context.Context) string {
|
||||
return ctx.Value(cacheControlHeaderCtxKey).(string)
|
||||
str, _ := ctx.Value(cacheControlHeaderCtxKey).(string)
|
||||
return str
|
||||
}
|
||||
|
||||
func getExpiresHeader(ctx context.Context) string {
|
||||
return ctx.Value(expiresHeaderCtxKey).(string)
|
||||
str, _ := ctx.Value(expiresHeaderCtxKey).(string)
|
||||
return str
|
||||
}
|
||||
|
@@ -1046,7 +1046,8 @@ func parsePath(ctx context.Context, r *http.Request) (context.Context, error) {
|
||||
}
|
||||
|
||||
func getImageURL(ctx context.Context) string {
|
||||
return ctx.Value(imageURLCtxKey).(string)
|
||||
str, _ := ctx.Value(imageURLCtxKey).(string)
|
||||
return str
|
||||
}
|
||||
|
||||
func getProcessingOptions(ctx context.Context) *processingOptions {
|
||||
|
Reference in New Issue
Block a user