Skip to content

Commit

Permalink
Improve urlencoding fallback message
Browse files Browse the repository at this point in the history
  • Loading branch information
anticorrelator committed Aug 16, 2024
1 parent e40b169 commit 9d23413
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/phoenix-otel/src/phoenix/otel/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ def parse_env_headers(s: str) -> Dict[str, str]:
if len(parts) == 2:
name, value = parts
encoded_header = f"{urllib.parse.quote(name)}={urllib.parse.quote(value)}"
_logger.warning(
f"Header values in environment variables should be URL encoded: ``{header}`` "
f"-> ``{encoded_header}``"
)
match = _HEADER_PATTERN.fullmatch(encoded_header.strip())
if not match:
_logger.warning(
Expand All @@ -74,6 +70,10 @@ def parse_env_headers(s: str) -> Dict[str, str]:
header,
)
continue
_logger.warning(
f"Header values in environment variables should be URL encoded, ``{header}`` "
f"was urlencoded to: ``{encoded_header}``"
)

name, value = header.split("=", 1)
name = urllib.parse.unquote(name).strip().lower()
Expand Down

0 comments on commit 9d23413

Please sign in to comment.