sumoheavy / jira-ruby

A Ruby gem for the JIRA REST API
MIT License
654 stars 412 forks source link

Multipart default headers #415

Closed marlinpierce closed 5 months ago

marlinpierce commented 10 months ago

I could not upload attachments onto issues. I got a response that I did not have permissions to view the issue. However, I found it was a bug that mulitpart posts were not passing the default headers from the client. I am using OAuth 2.0, passing the Jira OAuth Access Token as a bearer token header.

This PR:

  1. Fixes passing default headers with multipart posts.
  2. Replaces the deprecated alias UploadIO with Multipart::Post::UploadIO.
marlinpierce commented 9 months ago

@SimonMiaou

I added tests. This covers PR 393 so this can close that PR.

marlinpierce commented 8 months ago

I removed a change to the save attachment URI to move it to its own PR. It is needed to get save attachment to work because the Jira API is not strictly following the REST convention.

bobbrodie commented 5 months ago

This is really helpful @marlinpierce -- thank you so much. I'm catching up on PRs and will reach out to you and some others as we approach a new version since it's been a while.

Also, thanks for the test improvements!