You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the Box Developer Forums and my issue isn't already reported (or if it has been reported, I have attached a link to it, for reference).
I am trying to download a file with a name containing the special character ÿ and the client throws an error.
For instance:
Steps to Reproduce
Create a file with a name containing the character ÿ.
Get the box id of that file
Call the following code
client=<insertboxsdkinit>
id = <insertboxfileid>
const tmpFile = `/tmp/${id}`
const stream = await client.files.getReadStream(id)
const out = fs.createWriteStream(tmpFile)
// Wait for download to be over
await new Promise((resolve, reject) =>{stream.on('error',err=>{reject(err)})stream.on('end',function(){resolve()})stream.pipe(out)})
console.log(tmpFile)
Expected Behavior
It should not crash.
Alternatively, it should crash with a better error. Maybe something like Filename contains unsupported characters.
Error Message, Including Stack Trace
It throws an error with the following stack trace:
Error: Parse Error: Invalid header value char
at TLSSocket.socketOnData (_http_client.js:479:22)
at TLSSocket.emit (events.js:316:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:273:9)
at TLSSocket.Readable.push (_stream_readable.js:214:10)
at TLSWrap.onStreamRead (internal/stream_base_commons.js:186:23)
I also have the following error code in my log:
"code": "HPE_INVALID_HEADER_TOKEN",
I am pretty sure other weird characters would raise the same error.
Versions Used
Node SDK: 1.32.0
The text was updated successfully, but these errors were encountered:
@etiennebatise I am not able to replicate this issue. I was able to download a file with the special character ÿ. I used the code below
client.files.getReadStream('file_id', null, function(error, stream) {
if (error) {
// handle error
}
// write the file to disk
var output = fs.createWriteStream('/Users/sgarlanka/Desktop/ÿellow.pdf');
stream.pipe(output);
});
Are you still having this issue or was Sujay able to help you resolve it? I'll close it for now, but if you still need help, please just re-open and comment!
I come back after a while to confirm this is still happening in 1.35. @sujaygarlanka , I can't tell if your test has the same context. In my case, the bug happens when the file on box has a ÿ in its name. The local file name is unimportant.
After a bit of digging, I found out issues with a similar stack trace mentioning the http-parser of nodejs. See:
I can't confirm this is related but that might be a good starting point. I have tried to follow the call stack of files.getReadStream but I couldn't find where the download happens.
Description of the Issue
I am trying to download a file with a name containing the special character
ÿ
and the client throws an error.For instance:
Steps to Reproduce
ÿ
.Expected Behavior
It should not crash.
Alternatively, it should crash with a better error. Maybe something like
Filename contains unsupported characters
.Error Message, Including Stack Trace
It throws an error with the following stack trace:
I also have the following error code in my log:
I am pretty sure other weird characters would raise the same error.
Versions Used
Node SDK:
1.32.0
The text was updated successfully, but these errors were encountered: