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
2 changes: 1 addition & 1 deletion .github/workflows/addlicense.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-ci-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
name: Docker Build ${{ matrix.platform }}

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1
with:
persist-credentials: false
fetch-depth: 0
Expand All @@ -60,7 +60,7 @@ jobs:

- name: Generate Docker Metadata (Tags and Labels)
id: meta
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # 5.8.0
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # 5.9.0
with:
images: ghcr.io/${{ steps.image-name.outputs.IMAGE_NAME }}
flavor: |
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:

- name: Generate Docker Metadata (Tags and Labels)
id: meta
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # 5.8.0
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # 5.9.0
with:
images: ghcr.io/${{ steps.image-name.outputs.IMAGE_NAME }}
flavor: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1
with:
persist-credentials: false
fetch-depth: 0

- name: Setup QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # 3.6.0
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # 3.7.0
with:
platforms: arm64

Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1
with:
persist-credentials: false
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0 # Required for pushing commits to PRs
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- tests

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # 6.0.0
with:
python-version: "3.13"
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
- tests

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # 6.0.0
with:
python-version: "3.13"
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
--add-host=host.docker.internal:host-gateway
timeout-minutes: 30
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
--add-host=host.docker.internal:host-gateway
timeout-minutes: 30
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -294,14 +294,14 @@ jobs:
runs-on: windows-2025
timeout-minutes: 30
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
git fetch --tags origin

- name: Install uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # 7.1.2
uses: astral-sh/setup-uv@5a7eac68fb9809dea845d802897dc5c723910fa3 # 7.1.3

- name: Install Python
run: |
Expand Down Expand Up @@ -363,14 +363,14 @@ jobs:
runs-on: windows-11-arm
timeout-minutes: 30
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
git fetch --tags origin

- name: Install uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # 7.1.2
uses: astral-sh/setup-uv@5a7eac68fb9809dea845d802897dc5c723910fa3 # 7.1.3

- name: Install Python
run: |
Expand Down Expand Up @@ -443,7 +443,7 @@ jobs:
--add-host=host.docker.internal:host-gateway
timeout-minutes: 30
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -526,7 +526,7 @@ jobs:
--health-retries 10

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -606,7 +606,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -687,7 +687,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -772,7 +772,7 @@ jobs:
# from every being executed as bash commands.

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -837,7 +837,7 @@ jobs:
--add-host=host.docker.internal:host-gateway
timeout-minutes: 30
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -927,7 +927,7 @@ jobs:
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: L3

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1005,7 +1005,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1083,7 +1083,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1161,7 +1161,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1244,7 +1244,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1327,7 +1327,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1406,7 +1406,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1487,7 +1487,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1567,7 +1567,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1647,7 +1647,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1726,7 +1726,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1804,7 +1804,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -1923,7 +1923,7 @@ jobs:
--add-host=host.docker.internal:host-gateway

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -2003,7 +2003,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down Expand Up @@ -2081,7 +2081,7 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1

- name: Fetch git tags
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # 5.0.1
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0
Expand Down Expand Up @@ -61,6 +61,6 @@ jobs:

- name: Upload Trivy scan results to GitHub Security tab
if: ${{ github.event_name == 'schedule' }}
uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee # 4.31.2
uses: github/codeql-action/upload-sarif@014f16e7ab1402f30e7c3329d33797e7948572db # 4.31.3
with:
sarif_file: "trivy-results.sarif"
20 changes: 18 additions & 2 deletions newrelic/api/asgi_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,20 @@ async def send_inject_browser_agent(self, message):

message_type = message["type"]
if message_type == "http.response.start" and not self.initial_message:
headers = list(message.get("headers", ()))
# message["headers"] may be a generator, and consuming it via process_response will leave the original
# application with no headers. Fix this by preserving them in a list before consuming them.
if "headers" in message:
message["headers"] = headers = list(message["headers"])
else:
headers = []

# Check if we should insert the HTML snippet based on the headers.
# Currently if there are no headers this will always be False, but call the function
# anyway in case this logic changes in the future.
if not self.should_insert_html(headers):
await self.abort()
return

message["headers"] = headers
self.initial_message = message
elif message_type == "http.response.body" and self.initial_message:
Expand Down Expand Up @@ -232,7 +242,13 @@ async def send(self, event):
finally:
self.__exit__(*sys.exc_info())
elif event["type"] == "http.response.start":
self.process_response(event["status"], event.get("headers", ()))
# event["headers"] may be a generator, and consuming it via process_response will leave the original
# ASGI application with no headers. Fix this by preserving them in a list before consuming them.
if "headers" in event:
event["headers"] = headers = list(event["headers"])
else:
headers = []
self.process_response(event["status"], headers)
return await self._send(event)


Expand Down
Loading
Loading