Skip to content

Commit

Permalink
Add RequestIdPolicy to default policies (Azure#9841)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft authored Feb 13, 2020
1 parent c3203ec commit 1bb75ee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions sdk/core/azure-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

## 1.2.3 (Unreleased)

### Bug fixes

- Appended RequestIdPolicy to the default pipeline

## 1.2.2 (2020-02-10)

Expand Down
5 changes: 4 additions & 1 deletion sdk/core/azure-core/azure/core/_pipeline_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
from .configuration import Configuration
from .pipeline import Pipeline
from .pipeline.transport._base import PipelineClientBase
from .pipeline.policies import ContentDecodePolicy, DistributedTracingPolicy, HttpLoggingPolicy
from .pipeline.policies import (
ContentDecodePolicy, DistributedTracingPolicy, HttpLoggingPolicy, RequestIdPolicy
)
from .pipeline.transport import RequestsTransport

try:
Expand Down Expand Up @@ -101,6 +103,7 @@ def _build_pipeline(self, config, **kwargs): # pylint: disable=no-self-use

if policies is None: # [] is a valid policy list
policies = [
RequestIdPolicy(**kwargs),
config.headers_policy,
config.user_agent_policy,
config.proxy_policy,
Expand Down
5 changes: 4 additions & 1 deletion sdk/core/azure-core/azure/core/_pipeline_client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
from .configuration import Configuration
from .pipeline import AsyncPipeline
from .pipeline.transport._base import PipelineClientBase
from .pipeline.policies import ContentDecodePolicy, DistributedTracingPolicy, HttpLoggingPolicy
from .pipeline.policies import (
ContentDecodePolicy, DistributedTracingPolicy, HttpLoggingPolicy, RequestIdPolicy
)

try:
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -100,6 +102,7 @@ def _build_pipeline(self, config, **kwargs): # pylint: disable=no-self-use

if policies is None: # [] is a valid policy list
policies = [
RequestIdPolicy(**kwargs),
config.headers_policy,
config.user_agent_policy,
config.proxy_policy,
Expand Down

0 comments on commit 1bb75ee

Please sign in to comment.