Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for merging header-timers with existing Server-Timing headers #2

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tbeseda
Copy link
Owner

@tbeseda tbeseda commented May 2, 2024

[note from tbeseda (the rest is Copilot): I'm testing out Copilot Workspace trial]

Related to #1

Adds support for merging header-timers values with existing Server-Timing headers without overwriting, and updates documentation and tests accordingly.

  • New Feature Implementation:
    • Introduces a mergeWithExisting method in index.js that allows merging header-timers values with existing Server-Timing headers, supporting both string and object formats for existing headers.
    • Modifies the toObject method to facilitate merging by handling existing headers passed as either a string or an object, including cases where the Server-Timing header is already present.
  • Documentation Updates:
    • Enhances the README.md file with a new section and examples on how to use the mergeWithExisting method for merging header-timers values with existing Server-Timing headers.
  • Testing Enhancements:
    • Adds tests in index-test.js to verify the correct functionality of the mergeWithExisting method, including tests for merging with existing headers provided as both strings and objects.

For more details, open the Copilot Workspace session.

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.

1 participant