fix a bug in Ox.decodeDeflate (slice(1,-0) returns '')
This commit is contained in:
parent
12296c41db
commit
bf02d50909
1 changed files with 3 additions and 1 deletions
|
@ -223,7 +223,9 @@ Ox.decodeDeflate = function(string, callback) {
|
||||||
try {
|
try {
|
||||||
// Parse the first byte as number of bytes to chop at the end,
|
// Parse the first byte as number of bytes to chop at the end,
|
||||||
// and the rest, without these bytes, as an UTF8-encoded string.
|
// and the rest, without these bytes, as an UTF8-encoded string.
|
||||||
string = Ox.decodeUTF8(string.slice(1, -string.charCodeAt(0)));
|
string = Ox.decodeUTF8(
|
||||||
|
string.slice(1, -string.charCodeAt(0) || void 0)
|
||||||
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error();
|
error();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue