Skip to content

Commit

Permalink
Change Authorization header masking logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiAndreiev committed Sep 6, 2024
1 parent 9883284 commit 928640b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/python/readme_metrics/PayloadBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ def _build_request_payload(self, request) -> dict:
else:
post_data = self._process_body(content_type, request.rm_body)

headers = dict(headers)

if "Authorization" in headers:
headers["Authorization"] = mask(headers["Authorization"])

payload = {
"method": request.method,
"url": self._build_base_url(request),
Expand All @@ -220,11 +225,6 @@ def _build_request_payload(self, request) -> dict:
"bodySize": -1,
}

if "Authorization" in headers:
payload["headers"].append(
{"name": "Authorization", "value": mask(headers["Authorization"])}
)

if not post_data is False:
payload["postData"] = post_data

Expand Down

0 comments on commit 928640b

Please sign in to comment.