Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sdk/core/azure-core/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down
6 changes: 5 additions & 1 deletion sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__()
Expand Down Expand Up @@ -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(
Expand Down