"invalid digit found in string while parsing with radix 16"

I'm trying to use the following expression in my rule:
(http.request.uri.path.extension in {"jpg" "jpeg" "png" "gif"}) and (not (any(http.request.headers["via"][*] contains "image-resizing"))) and (not (any(http.request.headers["referer"][*] eq http.request.full_uri)))
(http.request.uri.path.extension in {"jpg" "jpeg" "png" "gif"}) and (not (any(http.request.headers["via"][*] contains "image-resizing"))) and (not (any(http.request.headers["referer"][*] eq http.request.full_uri)))
There seems to be a problem with the following part - without it it works perfectly fine:
(not (any(http.request.headers["referer"][*] eq http.request.full_uri)))
(not (any(http.request.headers["referer"][*] eq http.request.full_uri)))
It also works if I replace it with a constant like this (but that doesn't really solve my issue):
(not (any(http.request.headers["referer"][*] eq "abc123")))
(not (any(http.request.headers["referer"][*] eq "abc123")))
The error I'm getting is:
'(http.request.uri.path.extension in {"jpg" "jpeg" "png" "gif"}) and (not (any(http.request.headers["via"][*] contains "image-resizing"))) and (not (any(http.request.headers["referer"][*] eq http.request.full_uri)))' is not a valid value for expression because the expression is invalid: Filter parsing error (1:191): (http.request.uri.path.extension in {"jpg" "jpeg" "png" "gif"}) and (not (any(http.request.headers["via"][*] contains "image-resizing"))) and (not (any(http.request.headers["referer"][*] eq http.request.full_uri))) ^^ invalid digit found in string while parsing with radix 16 (Code: 20127)
'(http.request.uri.path.extension in {"jpg" "jpeg" "png" "gif"}) and (not (any(http.request.headers["via"][*] contains "image-resizing"))) and (not (any(http.request.headers["referer"][*] eq http.request.full_uri)))' is not a valid value for expression because the expression is invalid: Filter parsing error (1:191): (http.request.uri.path.extension in {"jpg" "jpeg" "png" "gif"}) and (not (any(http.request.headers["via"][*] contains "image-resizing"))) and (not (any(http.request.headers["referer"][*] eq http.request.full_uri))) ^^ invalid digit found in string while parsing with radix 16 (Code: 20127)
1 Reply
Metriusz
MetriuszOP10mo ago
For context I'm trying to set up a transform rule for image resizing and without that part it goes into an infinite loop for invalid images I'm rewriting the path to:
concat("/cdn-cgi/image/format=auto,metadata=none", http.request.uri.path)
concat("/cdn-cgi/image/format=auto,metadata=none", http.request.uri.path)
Oh The error message is a bit unintuitive
Want results from more Discord servers?
Add your server