YOURLS / YOURLS

🔗 The de facto standard self hosted URL shortener in PHP
https://yourls.org
MIT License
10.8k stars 1.95k forks source link

Decoding URL (keyword) to detect if user asked for statistics (iOS17+, macOS14+) #3696

Closed xhruso00 closed 10 months ago

xhruso00 commented 10 months ago

Code of Conduct

Submission validity

Summary

As of macOS Sonoma/iOS 17 the apple platforms are doing "best effort" to encode characters in malformed URLs (if it doesn't have a protocol such as https/http). https://developer.apple.com/documentation/foundation/nsurl/1572047-urlwithstring

This is causing the stats symbol "+" (plus) to be encoded as %2b on apple platforms in case user manually enters url and types a plus symbol.

The bitly team has updated their behaviour and entering url "bit.ly/45ibdl3+" without protocol will correctly show stats for the URL despite the request being encoded as https://bit.ly/45ibdl3%2b

Motivation

Apple changed behaviour and instead of prepending a protocol they are also trying best effort to encode url (only if protocol wasn't originally there).

Describe the solution

No response

xhruso00 commented 10 months ago

This behavior was caused by namecheap's force https redirect configuration:

@Mareks-MacBook-Pro-M1 Downloads % curl -vvv 111.eu/ozh+

Other shared webhosting: @Mareks-MacBook-Pro-M1 Downloads % curl -vvv yourls.111.com/K39E2W+