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

Decode The Path #591

Merged
merged 2 commits into from
Aug 16, 2018
Merged

Decode The Path #591

merged 2 commits into from
Aug 16, 2018

Conversation

jonwinton
Copy link
Contributor

So, when _uris are made for pages on publish the url to expose is passed through Node's url.parse method which encodes the url's path.

So if I want to publish to a url like www.thecut.com/author/catie-l'heureux/, the uri that's created only is encoded: www.thecut.com/author/catie-l%27heureux/ and gets saved in the database as such.

Then when you request the public url...

  1. you get a 404 because the that's base64 encoded contains the uri encoded url
    OR
  2. if you requested the uri encoded url, Express decodes the uri when it's exposed to Amphora and so you can't resolve the proper _uri.

Basically, decode the path of the url when you're making the _uri .

@coveralls
Copy link

coveralls commented Aug 16, 2018

Pull Request Test Coverage Report for Build 1955

  • 3 of 3 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 1954: 0.0%
Covered Lines: 4241
Relevant Lines: 4241

💛 - Coveralls

Copy link

@yuliyv yuliyv left a comment

Choose a reason for hiding this comment

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

👒

@jonwinton jonwinton merged commit aea9155 into master Aug 16, 2018
@jonwinton jonwinton deleted the the-encode-mystery branch August 16, 2018 16:53
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