Workers with Null query string arguments


#1

I’ve recently written a worker that intercepts requests and shows a maintenance page to external users and allows company staff to access a site during maintenance periods - everything typically works just fine, however we’ve noticed an issue with query strings that have null values.

Consider the following request url:
https://example.com/somepage?Key1=test&key2=&key3=example

In the above request - the Worker yeilds the following down to the origin (without the = sign on Key2):
https://example.com/somepage?Key1=test&key2&key3=example

I cant find any RFC’s indicating that my request URL is bad - Is this expected behaviour from the Workers engine?

Thanks,


#2

Hi @patrick.squire,

Your URLs are correct. Our URL class has a bug which drops the equals sign separator from null-valued query parameters. Thanks for the report! Expect a fix to land sometime next week.

Harris


#3

Thanks @harris :slight_smile:


#4

@squip, just wanted to let you know the fix for this is now live.


#5

Nice one @harris - thanks a ton.