Skip to content

Fix auto-headers for aiohttp (for real this time :))#7749

Merged
lmazuel merged 2 commits intomasterfrom
auto_header_aiohttp_fix
Oct 9, 2019
Merged

Fix auto-headers for aiohttp (for real this time :))#7749
lmazuel merged 2 commits intomasterfrom
auto_header_aiohttp_fix

Conversation

@lmazuel
Copy link
Member

@lmazuel lmazuel commented Oct 9, 2019

In some scenario, aiohttp is setting content-type for us. This might be something we don't want, for instance for Storage it was breaking the signature (Content-Type being part of the signature, the signature didn't match anymore). First attempt to fix was then to say to aiohttp "whatever scenario, don't do auto-headers": #6992

But this one broke the formdata tests: because when using "multipart/form-data" you really want aiohttp to do that for you (there is a boundary to generate, etc.).

So this PR is being more explicit: if we know for sure this request comes with no body: don't let aiohttp add automatically "Content-Type". I believe it's more accurate to what we wanted to fix anyway.

Side note @scbedd : if this issue #4773 was implemented, we would have caught that earlier :/. No blaming, just to give context for the value that would bring #4773

@AutorestCI
Copy link
Contributor

AutorestCI commented Oct 9, 2019

(message created by the CI based on PR content)

Installation instruction

Package azure-core

You can install the package azure-core of this PR using the following command:
pip install "git+https://github.com/Azure/azure-sdk-for-python@auto_header_aiohttp_fix#egg=azure-core&subdirectory=azure-core"

You can build a wheel to distribute for test using the following command:
pip wheel --no-deps "git+https://github.com/Azure/azure-sdk-for-python@auto_header_aiohttp_fix#egg=azure-core&subdirectory=azure-core"

If you have a local clone of this repository, you can also do:

  • git checkout auto_header_aiohttp_fix
  • pip install -e ./azure-core

Or build a wheel file to distribute for testing:

  • git checkout auto_header_aiohttp_fix
  • pip wheel --no-deps ./azure-core

Direct download

Your files can be directly downloaded here:

@lmazuel lmazuel merged commit 4869f89 into master Oct 9, 2019
@lmazuel lmazuel deleted the auto_header_aiohttp_fix branch October 9, 2019 23:41
xiangyan99 added a commit that referenced this pull request Oct 10, 2019
* increment key vault version (#7704)

* Update ep livetest according to storage-blob-b4 (#7725)

* Bug fix #6690 (#7738)

* Fix auto-headers for aiohttp (for real this time :)) (#7749)

* Fix auto-headers for aiohttp

* ChangeLog

* [AutoPR frontdoor/resource-manager] some fixes for frontdoor readme (#7714)

* Generated from e5fa469589e9cddf953d91122ebf61fc705ea8bb

renamed aggregation intervals

* Generated from 729f3420dad818c11e458aa67483039fd9b48778

Updated timeseriesType

* Generated from 9630e7a1f4c4c443797f8efa12d20bf1cf7a4dee

scorecard -> scoreboard

* Generated from 3a7dbc786a7789ef058736e2dfa8be0f7ab5f53d

network experiment resource state

* Packaging update of azure-mgmt-frontdoor

* changelog

* Fix requests asyncio if input data is async gen (#7743)

* Fix requests asyncio if input data is async gen

* ChangeLog

* Feedback

* Update HISTORY.md

* update user agent string (#7750)

* remove get_pending_certificate_signing_request (#7560)
xiangyan99 added a commit that referenced this pull request Oct 10, 2019
* move config into kwargs

* use pop to avoid dup values for kw arguement 'config'

* update doc

* fix cosmos client

* pylint fix

* remove config

* fix typo

* Get latest master (#7770)

* increment key vault version (#7704)

* Update ep livetest according to storage-blob-b4 (#7725)

* Bug fix #6690 (#7738)

* Fix auto-headers for aiohttp (for real this time :)) (#7749)

* Fix auto-headers for aiohttp

* ChangeLog

* [AutoPR frontdoor/resource-manager] some fixes for frontdoor readme (#7714)

* Generated from e5fa469589e9cddf953d91122ebf61fc705ea8bb

renamed aggregation intervals

* Generated from 729f3420dad818c11e458aa67483039fd9b48778

Updated timeseriesType

* Generated from 9630e7a1f4c4c443797f8efa12d20bf1cf7a4dee

scorecard -> scoreboard

* Generated from 3a7dbc786a7789ef058736e2dfa8be0f7ab5f53d

network experiment resource state

* Packaging update of azure-mgmt-frontdoor

* changelog

* Fix requests asyncio if input data is async gen (#7743)

* Fix requests asyncio if input data is async gen

* ChangeLog

* Feedback

* Update HISTORY.md

* update user agent string (#7750)

* remove get_pending_certificate_signing_request (#7560)

* pylint fix

* update history.md
fengzhou-msft pushed a commit that referenced this pull request Nov 5, 2019
* Fix auto-headers for aiohttp

* ChangeLog
fengzhou-msft pushed a commit that referenced this pull request Nov 5, 2019
* move config into kwargs

* use pop to avoid dup values for kw arguement 'config'

* update doc

* fix cosmos client

* pylint fix

* remove config

* fix typo

* Get latest master (#7770)

* increment key vault version (#7704)

* Update ep livetest according to storage-blob-b4 (#7725)

* Bug fix #6690 (#7738)

* Fix auto-headers for aiohttp (for real this time :)) (#7749)

* Fix auto-headers for aiohttp

* ChangeLog

* [AutoPR frontdoor/resource-manager] some fixes for frontdoor readme (#7714)

* Generated from e5fa469589e9cddf953d91122ebf61fc705ea8bb

renamed aggregation intervals

* Generated from 729f3420dad818c11e458aa67483039fd9b48778

Updated timeseriesType

* Generated from 9630e7a1f4c4c443797f8efa12d20bf1cf7a4dee

scorecard -> scoreboard

* Generated from 3a7dbc786a7789ef058736e2dfa8be0f7ab5f53d

network experiment resource state

* Packaging update of azure-mgmt-frontdoor

* changelog

* Fix requests asyncio if input data is async gen (#7743)

* Fix requests asyncio if input data is async gen

* ChangeLog

* Feedback

* Update HISTORY.md

* update user agent string (#7750)

* remove get_pending_certificate_signing_request (#7560)

* pylint fix

* update history.md
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.

5 participants

Comments