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: Encode image url for static image uploads #385

Merged
merged 1 commit into from
Oct 3, 2019

Conversation

wwilsman
Copy link
Contributor

@wwilsman wwilsman commented Oct 3, 2019

Purpose

Images with a space in the name fail to capture properly. We should encode the image URL so that and other characters do not fail to capture.

Approach

Use encodeURIComponent to encode the image path as a url. Use that url for the image resource, and also encode the root resource URL as well.

Tests

Renamed the static percy.jpg file to percy home.jpg to test that the space is properly encoded. If Percy captures the snapshot, the test passes.

@wwilsman wwilsman requested a review from Robdel12 October 3, 2019 20:22
Copy link
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

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

🏁 Nice

@wwilsman wwilsman merged commit 6a52a9c into master Oct 3, 2019
@wwilsman wwilsman deleted the ww/fix-upload-image-url branch October 3, 2019 20:24
djones pushed a commit that referenced this pull request Oct 3, 2019
## [0.17.1](v0.17.0...v0.17.1) (2019-10-03)

### Bug Fixes

* 🐛 Encode image url for static image uploads ([#385](#385)) ([6a52a9c](6a52a9c))
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.

None yet

2 participants