Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin authored and ocelotl committed Mar 14, 2024
1 parent 109ac8c commit d71e093
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def client_response_hook(span: Span, message: dict):
import urllib
from functools import wraps
from timeit import default_timer
from typing import Any, Awaitable, Callable, Tuple, cast
from typing import Any, Awaitable, Callable, Tuple

from asgiref.compatibility import guarantee_single_callable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ def _custom_response_headers():
def _repeat_custom_response_headers():
headers = {
"content-type": "text/plain; charset=utf-8",
"my-custom-header": [
"my-custom-value-1", "my-custom-header-2"
],
"my-custom-header": ["my-custom-value-1", "my-custom-header-2"],
}
return flask.Response("test response", headers=headers)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,9 @@ def collect_custom_request_headers_attributes(environ):

for key, val in environ.items():
if key.startswith(_CARRIER_KEY_PREFIX):
header_key = key[_CARRIER_KEY_PREFIX_LEN:].replace("_", "-").lower()
header_key = (
key[_CARRIER_KEY_PREFIX_LEN:].replace("_", "-").lower()
)
if header_key in headers:
headers[header_key] += "," + val
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ def test_custom_response_headers_not_added_in_internal_span(self):
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE: "my-custom-header",
},
)
def test_custom_response_headers_added_in_server_span(self):
def test_repeat_custom_response_headers_added_in_server_span(self):
app = otel_wsgi.OpenTelemetryMiddleware(
wsgi_with_repeat_custom_response_headers
)
Expand Down

0 comments on commit d71e093

Please sign in to comment.