Open jwoertink opened 6 days ago
Could you capture the HTTP traffic so we can reproduce / investigate without iOS?
On Tue, Jun 25, 2024 at 9:13 AM Johannes Müller @.***> wrote:
Could you capture the HTTP traffic so we can reproduce / investigate without iOS?
Possibly. I have been working on tracing down the root cause. Fundamentally, what is happening is that a file upload (any file upload) via iOS results in this line in src/io/delimited.cr failing:
@.***_delimiter_buffer[0, read_bytes])
The reason is because the slice ends up being one byte too small, and when the parser tries to handle the "\r\n" line that appears after the multipart mime headers, it can't copy two bytes into a one-byte-long slice, and it blows up.
I have a temporary work around that just inserts a size check before the copy, and reallocates a new slice that is large enough if that situation is encountered. This solves the immediate problem of not being able to upgrade the software to 1.12.2, but is itself just an interim fix.
I will work on getting a reproducible example that doesn't require possession of an iOS device. I, myself, was debugging last night with my daughter's iPhone, which wasn't ideal for either of us. :)
Kirk Haines
From that investigation it seems you can forge a request that reproduces the issue without needing an iOS device?
On Tue, Jun 25, 2024 at 11:52 AM Julien Portalier @.***> wrote:
From that investigation it seems you can forge a request that reproduces the issue without needing an iOS device?
That is the goal, yes. I will capture an iOS transaction that can be reproduced and used in a test case that doesn't require the device itself.
Kirk Haines
We have a small Crystal app that handles our file uploads. Our production app is sitting on Crystal 1.6.2 and works fine(ish). We've recently started upgrading to 1.12 and working out bugs and such and ran in to an issue where uploading files from iPhone generally just don't work.
When uploading a file, we get this error
Works fine from desktop and Android phones, just not iPhone.
Here's a small code example that reproduces it locally.
It seems that this may be related to something in
IO::Delimited
. I'll try and get more info on this./cc. @wyhaines