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 decoding of the query section in "#annotations" fragments. #483

Merged
merged 1 commit into from
Jul 4, 2017

Conversation

robertknight
Copy link
Member

Use decodeURIComponent instead of decodeURI because
decodeURIComponent decodes reserved characters (eg. ":", "/") whereas
decodeURI does not.

Avoid stubbing decodeURIComponent in the tests and instead just use a
malformed escape sequence which triggers an actual URIError when
decoding.

Use `decodeURIComponent` instead of `decodeURI` because
`decodeURIComponent` decodes reserved characters (eg. ":", "/") whereas
`decodeURI` does not.

Avoid stubbing decodeURIComponent() in the tests and instead just use a
malformed escape sequence which triggers an actual URIError when
decoding.
@codecov
Copy link

codecov bot commented Jul 4, 2017

Codecov Report

Merging #483 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #483      +/-   ##
==========================================
+ Coverage   89.84%   89.87%   +0.03%     
==========================================
  Files         133      134       +1     
  Lines        5151     5305     +154     
  Branches      881      914      +33     
==========================================
+ Hits         4628     4768     +140     
- Misses        523      537      +14
Impacted Files Coverage Δ
src/annotator/config/settings.js 100% <100%> (ø) ⬆️
src/sidebar/frame-sync.js 92.1% <0%> (-1.65%) ⬇️
src/sidebar/reducers/frames.js 100% <0%> (ø) ⬆️
src/annotator/plugin/cross-frame.coffee 100% <0%> (ø) ⬆️
src/sidebar/unicode.coffee 100% <0%> (ø)
src/annotator/host.coffee 96.96% <0%> (+0.41%) ⬆️
src/sidebar/components/hypothesis-app.js 90.58% <0%> (+1.17%) ⬆️
src/annotator/util/frame-util.js 86.95% <0%> (+1.24%) ⬆️
src/annotator/guest.coffee 81.7% <0%> (+2.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee080fe...d0e4ada. Read the comment docs.

@seanh
Copy link
Contributor

seanh commented Jul 4, 2017

LGTM

@seanh seanh merged commit ccd6b50 into master Jul 4, 2017
@seanh seanh deleted the fix-url-frag-query-decoding branch July 4, 2017 10: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.

2 participants