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

BUGFIX: Wrong port assigned in applyTo() #2654

Merged

Conversation

kdambekalns
Copy link
Member

This fixes the following:

  • given an HTTPS connection to a proxy that passes the request handling to a server via HTTP
  • given a shortcut node pointing to http://www.acme.com
  • will result in http://www.acme.com:443 leading to errors

This fixes it by using the (at this point already set!) scheme of the $uri to fill in the standard
port.

This fixes the following:

- given an HTTPS connection to a proxy that passes the request handling to a server via HTTP
- given a shortcut node pointing to `http://www.acme.com`
- will result in `http://www.acme.com:443` leading to errors

This fixes it by using the (at this point already set!) scheme of the `$uri` to fill in the standard
port.
@kdambekalns kdambekalns self-assigned this Dec 21, 2021
@kdambekalns
Copy link
Member Author

Let's see if any test fails now… 😎

@kdambekalns
Copy link
Member Author

Ok, question… How on earth does that expectation make any sense?


1) Neos\Flow\Tests\Unit\Mvc\Routing\Dto\UriConstraintsTest::applyToTests with data set #1 (array('https'), 'http://some-domain.tld', false, 'https://some-domain.tld:80/')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'https://some-domain.tld:80/'
+'https://some-domain.tld/'

/home/runner/work/flow-development-collection/flow-development-collection/flow-development-distribution/Packages/Framework/Neos.Flow/Tests/Unit/Mvc/Routing/Dto/UriConstraintsTest.php:101

I mean, if I really want to talk HTTPS to port 80, I better pass in the port explicitly. No?

@kdambekalns
Copy link
Member Author

kdambekalns commented Dec 21, 2021

For me that second dataset should be

[
  'constraints' => [UriConstraints::CONSTRAINT_SCHEME => 'https'],
  'templateUri' => 'http://some-domain.tld',
  'forceAbsoluteUri' => false,
  'expectedUri' => 'https://some-domain.tld/'
]

or (in case we really want the "weird combo")

[
  'constraints' => [UriConstraints::CONSTRAINT_SCHEME => 'https', UriConstraints::CONSTRAINT_PORT => 80],
  'templateUri' => 'http://some-domain.tld',
  'forceAbsoluteUri' => false,
  'expectedUri' => 'https://some-domain.tld/'
]

Copy link
Member

@albe albe left a comment

Choose a reason for hiding this comment

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

Hm, somehow makes sense...

Copy link
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

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

Yes, that makes a lot of sense. Thanks for taking care!

@bwaidelich bwaidelich merged commit 17173e2 into neos:6.3 Jan 4, 2022
@kdambekalns kdambekalns deleted the bugfix/wrong-port-for-resolved-shortcut branch January 6, 2022 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants