Skip to content

magento/magento2:#6175 Fixed Unable to generate unsecure URL if current URL is secure #10188

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

Merged
merged 3 commits into from
Jul 14, 2017

Conversation

arshadpkm
Copy link
Contributor

@arshadpkm arshadpkm commented Jul 8, 2017

Description

When calling getUrl from a secure connection ( HTTPS ) with param _secure = false we are getting secure URL instead of unsecured.

Fixed Issues (if relevant)

  1. Unable to generate unsecure URL if current URL is secure #6175: Unable to generate unsecure URL if current URL is secure

Manual testing scenarios

###Preconditions

Magento 2 version 2.1.0
Use \Magento\Framework\Url::getUrl() from secure area of the store

###Steps to reproduce

Make sure code is executed in secure area of the store (HTTPS)
Generate URL in code
/**
* @var \Magento\Framework\Url
*/
protected $url;
...
$this->url->getUrl(
'test/test/test',
[
'_secure' => false
]
)

Expected result
http://example.com/test/test/test

Actual result
http://example.com/test/test/test

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@okorshenko okorshenko changed the base branch from 2.1 to 2.1-develop July 10, 2017 20:35
@okorshenko
Copy link
Contributor

Hi @arshadpkm
Thank you for your contribution. Could you please cover your fix with integration test so that we can verify that it works correctly. Thank you

@okorshenko okorshenko self-assigned this Jul 10, 2017
@okorshenko okorshenko added this to the July 2017 milestone Jul 10, 2017
@magento-team magento-team merged commit 839ea2f into magento:2.1-develop Jul 14, 2017
magento-team pushed a commit that referenced this pull request Jul 14, 2017
…re URL if current URL is secure #10188

 - changed flag to _secure_forced to be consistent with previous implementation
magento-team pushed a commit that referenced this pull request Jul 14, 2017
…re URL if current URL is secure #10188

 - changed flag to _secure
magento-team pushed a commit that referenced this pull request Jul 14, 2017
…re URL if current URL is secure #10188

 - added integration tests
magento-team pushed a commit that referenced this pull request Jul 14, 2017
…re URL if current URL is secure #10188

 - fixed ingration test
magento-team pushed a commit that referenced this pull request Jul 14, 2017
@arshadpkm arshadpkm deleted the issue-6175 branch July 15, 2017 16:18
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