Skip to content

Enable request headers and add replay-id header#1310

Merged
waltjones merged 2 commits into
masterfrom
waltjones/replay-id-request-header
Sep 18, 2025
Merged

Enable request headers and add replay-id header#1310
waltjones merged 2 commits into
masterfrom
waltjones/replay-id-request-header

Conversation

@waltjones

@waltjones waltjones commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Description of the change

This PR enables sending the X-Rollbar-Replay-Id request header, and sending arbitrary headers in general. To facilitate this and better manage the long arguments list for transport, transport arguments are refactored to use a params object.

Type of change

  • New feature (non-breaking change that adds functionality)

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

@waltjones waltjones force-pushed the waltjones/replay-id-request-header branch from e844662 to 5e56559 Compare September 18, 2025 14:32
@waltjones waltjones force-pushed the waltjones/replay-id-request-header branch from 5e56559 to bfaf2f6 Compare September 18, 2025 14:52

@matux matux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The important stuff looks good, just a super minor non-blocking comment.

Comment thread src/browser/transport/xhr.js Outdated
Comment on lines +89 to +91
for (const h of Object.keys(headers || {})) {
request.setRequestHeader(h, headers[h]);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick:

for (const [h, v] of Object.entries(headers ?? {})) {
  request.setRequestHeader(h, v);
}

I think this is more idiomatic.

non-blocking

Comment thread src/server/transport.js
callback,
transportFactory,
) {
}) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

😍

@waltjones waltjones merged commit d493180 into master Sep 18, 2025
4 checks passed
@waltjones waltjones deleted the waltjones/replay-id-request-header branch September 18, 2025 18:31
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.

2 participants