Make sure public facing URL has nil prove query string

When an URL is share on Facebook Post, facebook manipulate the URL by adding the facebook click id (&fbclid=blahblah).

In this process, it also causes empty query string to become nil. E.g.

Before:

https://your-address.com/?a=1&b=&c=test

After:

https://your-address.com/?a=1&b&c=test&fbclid=blahblah

Notice that b= has became b. The value of b changed from empty string to nil.

If your code is expecting some value (empty string is considered a value) but not expecting nil, this might breaks your code. Make sure when your code reads query string, it could handle such scenario. Otherwise your URL won't open after being share on Facebook.



AI Summary
Chrome On-device AI 2024-12-06 18:34:18

Share Article