Skip to content

[Bitbucket] Fixed broken update_file and upload_file API calls (fixes issue #1080) #1092

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

Merged
merged 3 commits into from
Dec 4, 2022

Conversation

jnbolito
Copy link
Contributor

@jnbolito jnbolito commented Dec 2, 2022

This fixes issue #1080 by removing the Content-Type: application/json header set when updating/uploading files. The issue occurs because Content-Type: application/json is a part of the default headers sent out, explicitly. This in turn prevents requests from adding the multipart/form-data Content-Type required by the Bitbucket API (as per the reference).

@jnbolito
Copy link
Contributor Author

jnbolito commented Dec 2, 2022

Hi @gonchik, it seems the tests are failing due to reasons unrelated to my changes 😅 ...

flake8
atlassian/rest_client.py:10:5: F401 'oauthlib.oauth1.SIGNATURE_RSA_SHA512' imported but unused
atlassian/bamboo.py:1200:5: F811 redefinition of unused 'upload_plugin' from line 1103
mypy
atlassian/bamboo.py:1200: error: Name 'upload_plugin' already defined on line 1103

Shall I fix them?

@gonchik
Copy link
Member

gonchik commented Dec 4, 2022

Hi!
I have adjusted, let me rerun it

@codecov-commenter
Copy link

Codecov Report

Base: 36.03% // Head: 36.03% // No change to project coverage 👍

Coverage data is based on head (b804ee2) compared to base (211f26b).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1092   +/-   ##
=======================================
  Coverage   36.03%   36.03%           
=======================================
  Files          38       38           
  Lines        7057     7057           
  Branches     1009     1009           
=======================================
  Hits         2543     2543           
  Misses       4407     4407           
  Partials      107      107           
Impacted Files Coverage Δ
atlassian/bitbucket/__init__.py 29.96% <0.00%> (ø)
atlassian/service_desk.py 38.98% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gonchik gonchik merged commit 858cbc0 into atlassian-api:master Dec 4, 2022
@gonchik
Copy link
Member

gonchik commented Dec 4, 2022

Thank you!

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.

3 participants