Skip to content

Fix upload multipart headers and encode invoke URL segments#53

Open
Chandraveersingh1717 wants to merge 4 commits intometacall:masterfrom
Chandraveersingh1717:fix-upload-invoke-encoding
Open

Fix upload multipart headers and encode invoke URL segments#53
Chandraveersingh1717 wants to merge 4 commits intometacall:masterfrom
Chandraveersingh1717:fix-upload-invoke-encoding

Conversation

@Chandraveersingh1717
Copy link

This PR fixes two request construction issues in the API client.

  1. upload()
    Forward FormData headers (fd.getHeaders()) when sending multipart
    requests with axios. Without these headers the multipart boundary
    may be missing, which can break /api/package/create in Node.

  2. invoke()
    Encode dynamic URL path segments (prefix, suffix, version, name)
    using encodeURIComponent() to correctly handle special characters
    such as spaces or slashes.

These fixes prevent malformed requests and improve client reliability.

Tests:

  • Added unit tests to verify multipart headers are forwarded.
  • Added tests to ensure invoke() correctly encodes URL segments.

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

Successfully merging this pull request may close these issues.

1 participant