Skip to content

Commit 115057b

Browse files
Petr Pchelkod00rman
authored andcommitted
Handle non-string input correctly
1 parent 9521938 commit 115057b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/reqTemplate.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ const globalMethods = {
151151
* @returns {string}
152152
*/
153153
decode(data) {
154-
return decodeURIComponent(data)
154+
if (typeof data !== 'string') {
155+
return data;
156+
}
157+
return decodeURIComponent(data);
155158
},
156159

157160
// Private helpers

0 commit comments

Comments
 (0)