Skip to content

Commit 9d7501b

Browse files
fixed encoding of JSON Pointer tokens (related to PR #90)
1 parent 9965c26 commit 9d7501b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/pointer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Pointer.join = function (base, tokens) {
195195
for (var i = 0; i < tokens.length; i++) {
196196
var token = tokens[i];
197197
// Encode the token, according to RFC 6901
198-
base += '/' + encodeURI(token.replace(tildes, '~0').replace(slashes, '~1'));
198+
base += '/' + encodeURIComponent(token.replace(tildes, '~0').replace(slashes, '~1'));
199199
}
200200

201201
return base;

test/specs/__({[ ! % & $ # @ ` ~ ,)}]__/special-characters.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe.only('File names with special characters', function () {
1+
describe('File names with special characters', function () {
22
'use strict';
33

44
it('should parse successfully', function () {

0 commit comments

Comments
 (0)