Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cURL doesn't like spaces in URLs #1

Open
rimas-kudelis opened this issue Jun 28, 2022 · 0 comments
Open

cURL doesn't like spaces in URLs #1

rimas-kudelis opened this issue Jun 28, 2022 · 0 comments

Comments

@rimas-kudelis
Copy link

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:

  1. please fix whitespace handling. A simple str_replace() call on the URL does the trick.
  2. 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant