Skip to content

call ds.trackReqHeaders() as needed in app middleware#4312

Merged
xzhou82 merged 2 commits intorelease-2.170from
gdc-x-forwarded
Mar 13, 2026
Merged

call ds.trackReqHeaders() as needed in app middleware#4312
xzhou82 merged 2 commits intorelease-2.170from
gdc-x-forwarded

Conversation

@siosonel
Copy link
Member

@siosonel siosonel commented Mar 13, 2026

Description

Call the optional ds.trackReqHeaders as needed in app.middleware, so that datasets like GDC can add request header fields that are required by their API.

Addresses https://gdc-ctds.atlassian.net/browse/FEAT-888 and https://gdc-ctds.atlassian.net/browse/FEAT-889.

Checklist

Check each task that has been performed or verified to be not applicable.

  • Tests: Added and/or passed unit and integration tests, or N/A
  • Todos: Commented or documented, or N/A
  • Notable Changes: updated release.txt, prefixed a commit message with "fix:" or "feat:", added to an internal tracking document, or N/A
  • Rust: Checked to see whether Rust needs to be re-compiled because of this PR, or N/A

Copilot AI review requested due to automatic review settings March 13, 2026 20:53
@siosonel siosonel changed the base branch from master to release-2.170 March 13, 2026 20:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for datasets (notably GDC) to optionally track incoming request headers in app middleware so downstream external-API calls can include required header fields.

Changes:

  • Add trackReqHeaders(req,res) and update getHostHeaders typing/docs on the dataset type.
  • Invoke dataset header tracking alongside abort-controller setup in server/src/app.middlewares.js.
  • Add an Unreleased changelog entry noting the fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
shared/types/src/dataset.ts Adds trackReqHeaders to the dataset type and updates docs/typing for external API host/headers helpers.
server/src/app.middlewares.js Hooks optional dataset request-header tracking into middleware and refactors abort-controller helper.
CHANGELOG.md Adds an Unreleased note about calling ds.trackReqHeaders() in middleware.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@xzhou82 xzhou82 merged commit 3ab5f40 into release-2.170 Mar 13, 2026
3 checks passed
@xzhou82 xzhou82 deleted the gdc-x-forwarded branch March 13, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants