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

Fix #14085 Shop url with port in header HOST #14089

Merged
merged 1 commit into from Jul 17, 2019

Conversation

@202-ecommerce
Copy link
Contributor

commented Jun 5, 2019

Questions Answers
Branch? develop
Description? When a server send a request with an host with port in HTTPS, Prestashop don't found the shop and send a redirection to HTTP url.
Type? bug fix
Category? CO
BC breaks? yes, potential BC with shop not on standart port 80 and/or 443
Deprecations? no
Fixed ticket? Fixes #14085
How to test? Le CLI curl -I -H "Host: www.my-prestashop.tld:443" https://www.my-prestashop.tld/ need return 200 status code not 301

This change is Reviewable

@202-ecommerce 202-ecommerce requested a review from PrestaShop/prestashop-core-developers as a code owner Jun 5, 2019

@PierreRambaud

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

Is it because the BO force the https?

@202-ecommerce

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2019

Is it because the BO force the https?

No, it's because Prestashop don't manage HTTP_HOST global variable properly with port inside.

Sampel requests header like:
URL: https://www.domain.tld
HOST: www.domain.tld:143

Prestashop look for a shop in table shop_url with domain or domain_ssl = "www.domain.tld:143"

It's obviously not found.

Browsers like Firefox or Chrome don't specify port in theire request header, but ATOS send it !

@PierreRambaud

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

So let's try for QA :D

@sarahdib sarahdib self-assigned this Jul 16, 2019

@sarahdib

This comment has been minimized.

Copy link

commented Jul 16, 2019

Hello @202-ecommerce
This is what I have when I execute the curl request with this PR

image

@clotaire202

This comment has been minimized.

Copy link

commented Jul 16, 2019

@sarahdib

To respect W3C and send a valid standart request, the right call should be something like :
curl -I -H "Host: www.your-prestashop.tld:443" https://www.your-prestashop.tld/Sarah/develop

  1. If you set Host header, you need supply only host, not the whole URL (with https and URI)
  2. The port is supply after the domain, not at the end of the URL

Many thanks.

@sarahdib sarahdib added QA ✔️ and removed waiting for QA labels Jul 17, 2019

@sarahdib sarahdib added this to the 1.7.7.0 milestone Jul 17, 2019

@matks

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2019

Thank you @202-ecommerce and @clotaire202

@matks matks merged commit 7dc9df8 into PrestaShop:develop Jul 17, 2019

2 checks passed

PrettyCI Code formatting
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@matks matks referenced this pull request Jul 17, 2019

Closed

Shop url with port #14085

mbadrani added a commit to mbadrani/PrestaShop that referenced this pull request Jul 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.