diff --git a/sdk/core/azure-core/HISTORY.md b/sdk/core/azure-core/HISTORY.md index 9ab8fb5ed6ee..aefe1cdfce9f 100644 --- a/sdk/core/azure-core/HISTORY.md +++ b/sdk/core/azure-core/HISTORY.md @@ -3,6 +3,12 @@ ------------------- +## 2019-XX-XX Version 1.0.0 + +### Bug fixes + +- Fix form-data with aiohttp transport #7749 + ## 2019-10-07 Version 1.0.0b4 ### Features @@ -32,7 +38,7 @@ - Tracing: `link` renamed `link_from_headers` and `link` takes now a string - Tracing: opencensus implementation has been moved to the package `azure-core-tracing-opencensus` - Some modules and classes that were importables from several differente places have been removed: - + - `azure.core.HttpResponseError` is now only `azure.core.exceptions.HttpResponseError` - `azure.core.Configuration` is now only `azure.core.configuration.Configuration` - `azure.core.HttpRequest` is now only `azure.core.pipeline.transport.HttpRequest` diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py b/sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py index bf6b5f2bdc5b..7430d84ae8fc 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py @@ -92,7 +92,6 @@ async def open(self): self.session = aiohttp.ClientSession( loop=self._loop, trust_env=self._use_env_settings, - skip_auto_headers=['Content-Type'] ) if self.session is not None: await self.session.__aenter__() @@ -169,6 +168,11 @@ async def send(self, request: HttpRequest, **config: Any) -> Optional[AsyncHttpR cert=config.pop('connection_cert', self.connection_config.cert), verify=config.pop('connection_verify', self.connection_config.verify) ) + # If we know for sure there is not body, disable "auto content type" + # Otherwise, aiohttp will send "application/octect-stream" even for empty POST request + # and that break services like storage signature + if not request.data and not request.files: + config['skip_auto_headers'] = ['Content-Type'] try: stream_response = config.pop("stream", False) result = await self.session.request(