Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uritemplate-js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
uritemplate-js
Commits
aa35786f
Commit
aa35786f
authored
May 26, 2013
by
fxa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pct-Encoding-Error with chars < 0x100 (missing 0-padding). Thanks to
https://github.com/pfraze
!
parent
19aa9f17
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
5 deletions
+10
-5
README.md
README.md
+1
-0
bin/uritemplate-min.js
bin/uritemplate-min.js
+1
-1
bin/uritemplate.js
bin/uritemplate.js
+1
-1
package.json
package.json
+2
-2
src/pctEncoder.js
src/pctEncoder.js
+1
-1
test/unit/testPctEncoder.js
test/unit/testPctEncoder.js
+4
-0
No files found.
README.md
View file @
aa35786f
...
@@ -62,6 +62,7 @@ MIT License, see http://mit-license.org/
...
@@ -62,6 +62,7 @@ MIT License, see http://mit-license.org/
Release Notes
Release Notes
-------------
-------------
*
0.3.3 fixed https://github.com/fxa/uritemplate-js/issues/12 Pct-Encoding-Error with chars < 0x100 (missing 0-padding). Thanks to https://github.com/pfraze!
*
0.3.2 fixed https://github.com/fxa/uritemplate-js/issues/11 Problems with older IE versions. Thanks to anozaki!
*
0.3.2 fixed https://github.com/fxa/uritemplate-js/issues/11 Problems with older IE versions. Thanks to anozaki!
*
0.3.1 fixed https://github.com/fxa/uritemplate-js/issues/10 thank you, Paul-Martin!
*
0.3.1 fixed https://github.com/fxa/uritemplate-js/issues/10 thank you, Paul-Martin!
*
0.3.0 introduced UriTemplateError as exception, so the interface changed from string to UriTemplateError (as the rfc suggested)
*
0.3.0 introduced UriTemplateError as exception, so the interface changed from string to UriTemplateError (as the rfc suggested)
...
...
bin/uritemplate-min.js
View file @
aa35786f
This diff is collapsed.
Click to expand it.
bin/uritemplate.js
View file @
aa35786f
...
@@ -181,7 +181,7 @@ var pctEncoder = (function () {
...
@@ -181,7 +181,7 @@ var pctEncoder = (function () {
index
;
index
;
for
(
index
=
0
;
index
<
octets
.
length
;
index
+=
1
)
{
for
(
index
=
0
;
index
<
octets
.
length
;
index
+=
1
)
{
octet
=
octets
.
charCodeAt
(
index
);
octet
=
octets
.
charCodeAt
(
index
);
result
+=
'
%
'
+
octet
.
toString
(
16
).
toUpperCase
();
result
+=
'
%
'
+
(
octet
<
0x10
?
'
0
'
:
''
)
+
octet
.
toString
(
16
).
toUpperCase
();
}
}
return
result
;
return
result
;
}
}
...
...
package.json
View file @
aa35786f
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
"template"
,
"template"
,
"rfc6570"
"rfc6570"
],
],
"author"
:
"Franz Antesberger"
,
"author"
:
"Franz
X
Antesberger"
,
"contributors"
:
[],
"contributors"
:
[],
"dependencies"
:
{},
"dependencies"
:
{},
"main"
:
"bin/uritemplate.js"
,
"main"
:
"bin/uritemplate.js"
,
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
"uritemplate-test/spec-examples-by-sections.json"
,
"uritemplate-test/spec-examples-by-sections.json"
,
"uritemplate-test/spec-examples.json"
"uritemplate-test/spec-examples.json"
],
],
"version"
:
"0.3.
2
"
,
"version"
:
"0.3.
3
"
,
"readmeFilename"
:
"README.md"
,
"readmeFilename"
:
"README.md"
,
"gitHead"
:
"901b85201a821427dfb4591b56aea3a70d45c67c"
,
"gitHead"
:
"901b85201a821427dfb4591b56aea3a70d45c67c"
,
"devDependencies"
:
{
"devDependencies"
:
{
...
...
src/pctEncoder.js
View file @
aa35786f
...
@@ -41,7 +41,7 @@ var pctEncoder = (function () {
...
@@ -41,7 +41,7 @@ var pctEncoder = (function () {
index
;
index
;
for
(
index
=
0
;
index
<
octets
.
length
;
index
+=
1
)
{
for
(
index
=
0
;
index
<
octets
.
length
;
index
+=
1
)
{
octet
=
octets
.
charCodeAt
(
index
);
octet
=
octets
.
charCodeAt
(
index
);
result
+=
'
%
'
+
octet
.
toString
(
16
).
toUpperCase
();
result
+=
'
%
'
+
(
octet
<
0x10
?
'
0
'
:
''
)
+
octet
.
toString
(
16
).
toUpperCase
();
}
}
return
result
;
return
result
;
}
}
...
...
test/unit/testPctEncoder.js
View file @
aa35786f
...
@@ -61,6 +61,10 @@ module.exports = (function () {
...
@@ -61,6 +61,10 @@ module.exports = (function () {
test
.
equal
(
pctEncoder
.
encodeCharacter
(
'
y
'
),
'
%79
'
);
test
.
equal
(
pctEncoder
.
encodeCharacter
(
'
y
'
),
'
%79
'
);
test
.
equal
(
pctEncoder
.
encodeCharacter
(
'
!
'
),
'
%21
'
);
test
.
equal
(
pctEncoder
.
encodeCharacter
(
'
!
'
),
'
%21
'
);
test
.
done
();
test
.
done
();
},
'
encoding is always padded
'
:
function
(
test
)
{
test
.
equal
(
pctEncoder
.
encodeCharacter
(
'
\n
'
),
'
%0A
'
);
test
.
done
();
}
}
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment