Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#20199 Reverted BaseUrl::isRelative() behaviour to previous 2.0.49 ve… #20203

Conversation

edegaudenzi
Copy link

…rsion due to yii\web\UrlManager::createAbsoluteUrl() malfunction depending on this.

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues #20199

…0.49 version due to yii\web\UrlManager::createAbsoluteUrl() malfunction depending on this.
@samdark samdark added this to the 2.0.50.1 milestone Jun 13, 2024
@samdark
Copy link
Member

samdark commented Jun 13, 2024

@edegaudenzi please check failing tests.

Copy link
Contributor

@rob006 rob006 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is incorrect, in reverts fix for #17191 (that is why tests fails).

Also, see #20199 (comment)

@edegaudenzi
Copy link
Author

Ok @samdark, I will at a certain point today. I've just given a brief look at them and seems a couple of tests are starting from the wrong assumption links like acme.com/test?tnt-link=https://tnt.com/ are valid URIs; accordingly to rfc3986 (T. Berners-Lee) they are not: their 'legal' counterpart would be instead the Percent-Encoding version of it: acme.com/test?tnt-link=https%3A%2F%2Ftnt.com%2F
But I'll let you know as soon as I can give a deeper look into it.

@rob006
Copy link
Contributor

rob006 commented Jun 14, 2024

I'm not sure why do you think that acme.com/test?tnt-link=https://tnt.com/ is not valid. This RFC explicitly mentions that you can skip encoding for readability:

https://stackoverflow.com/a/68151221/5812455

…compliant uris. Added couple of cases to also test the more relaxed rfc3986 section 3.4 definitions.
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.99%. Comparing base (ec46ede) to head (9f74eba).
Report is 24 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #20203      +/-   ##
============================================
- Coverage     64.99%   64.99%   -0.01%     
- Complexity    11391    11393       +2     
============================================
  Files           430      430              
  Lines         36923    36925       +2     
============================================
  Hits          23998    23998              
- Misses        12925    12927       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@edegaudenzi
Copy link
Author

As promised, on Friday I've dug deeper and found out the problem was in fact the a non rfc3986 compliant url in the tests. I've changed that one, and for sake of clarity I've also added an additional case aimed to test a more relaxed version of rfc3986, but still legal. Everything's is committed now in the pr.

@rob006
Copy link
Contributor

rob006 commented Jun 17, 2024

@edegaudenzi You may argue that acme.com/test?tnt-link=https://tnt.com/ is not a valid URL, but it is correctly handled by many tools (PHP included) and it is definitely not an absolute URL. Your PR introduces regression that treats acme.com/test?tnt-link=https://tnt.com/ as absolute URL (and thus breaking ensureScheme()) and you altered tests to hide this regression.

@samdark samdark removed this from the 2.0.50.1 milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants