Worker will failed when url contain "[" or "]"

I wrote a S3 index worker to serve my files. And if [ or ] contain in the request uri, I will got a 400 error with this :

<Error>
<Code>InvalidRequest</Code>
<Message>The server cannot or will not process the request due to something that is perceived to be a client error eg malformed request syntax invalid request message framing or deceptive request routing</Message>
</Error>

I was following this [toturial]( Backblaze B2 and the S3 Compatible API on Cloudflare) Cloudflare provide using aws4fetch.

Did anyone meet the same issue?

Why is there a bracket in the URI?

2 Likes

Shouldn’t they be encoded, if so?, but if they could be, will that work either that way for the URI (not URL)? :thinking:

1 Like

I’m not seeing any regular use for brackets in a URI or URL. I suppose it could be in a filename for some reason, but I can’t imagine it being a very good reason. Or at least one that would stop me from not using brackets in a URI.

1 Like

Agree :+1:

1 Like