Open
Description
I had trouble today while attempting to download a file from Bunny. The first request (directory list) would succeed, but the second one (file download) would fail with a very non-descriptive error code 3 and no error message whatsoever, without even attempting to connect to the server.
A Google search hinted that error 3 has something to do with malformed URL's, but it took me a while to figure out that the problem was caused by a whitespace character in the file name. This doesn't seem documented anywhere, but I found a StackOverflow thread about it.
So, I have two alternative propositions:
- please fix whitespace handling. A simple
str_replace()
call on the URL does the trick. - consider using PSR-18 HTTP client instead of cURL directly. cURL itself is too low level, difficult to debug, doesn't support logging and may even be unavailable. PSR-18 would abstract away this ugly dependency.
Metadata
Metadata
Assignees
Labels
No labels