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

Recipe Robot curl command fails when URL contains & #197

Closed
homebysix opened this issue Oct 15, 2023 · 1 comment
Closed

Recipe Robot curl command fails when URL contains & #197

homebysix opened this issue Oct 15, 2023 · 1 comment
Assignees
Labels

Comments

@homebysix
Copy link
Owner

Describe the bug
Recipe Robot produces an error when processing a URL that contains an unescaped ampersand, even if the URL is valid. This is due to an upstream failure in curl.

This URL, including spaces and ampersand, is valid. It downloads a file when loaded in a browser:
http://s3.amazonaws.com/belightsoft/updates/Labels & Addresses.tar.bz2

However, when processing with curl, an error is produced:

% curl -svIL "http://s3.amazonaws.com/belightsoft/updates/Labels & Addresses.tar.bz2"
* URL rejected: Malformed input to a URL function
* Closing connection -1

One solution may be to quote the URL:

% curl -sIL 'http://s3.amazonaws.com/belightsoft/updates/Labels%20%26%20Addresses.tar.bz2'
HTTP/1.1 200 OK
x-amz-id-2: XviSCCGlT2tQ4Es6W0n8z3AqVxmrlX6nmvVAQ7u3jkxmzq6geD0pA8/jPxdvl6SrnWcEzwgsLmw=
x-amz-request-id: DD3MXYWXEF14655Y
Date: Sun, 15 Oct 2023 20:48:41 GMT
Last-Modified: Mon, 16 May 2016 12:13:00 GMT
ETag: "84629ef3b7ca93e1f61ae1ce0d04cb63"
Accept-Ranges: bytes
Content-Type: application/x-bzip2
Server: AmazonS3
Content-Length: 47212146

However it's hard to tell which URLs to quote and which to leave as is.

Environment:

  • macOS: 14.0
  • Recipe Robot Version: 2.3.0
  • autopkg version: 3.0.0rc2
  • /usr/local/autopkg/python --version: 3.10.4
@homebysix
Copy link
Owner Author

Should be resolved in v2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant