GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Make `tracePropagationTargets` matching case-insensitive · Issue #16018 · getsentry/sentry-javascript

Make tracePropagationTargets matching case-insensitive #16018

New issue
Copy link
New issue
Copy link
Closed
#23534
Closed
Make tracePropagationTargets matching case-insensitive#16018
#23534
Copy link
Assignees
chargome
Labels
CoreImprovementMeta: Breaking
Milestone
11.0.0

Description

@Lms24
Lms24
opened on Apr 9, 2025
Issue body actions

Problem Statement

Currently, we have a bit of an obscure problem with tracePropagationTargets:

If users make a fetch request to a URL with casing (for whatever reason), they likely apply the same casing when defining tracePropagationTargets:

Sentry.init({
  tracePropagationTargets: ['myApi.com', /^myApi.com\/.*/]
})

fetch('https://myApi.com');

Unfortunately, the values in tracePropagationTargets counter-intuitively don't match because we create a new URL() from the URL passed to fetch when determining if our tracing headers should be attached.

The constructed URL object converts the entered url though to all-lower-case, meaning that when matching myapi.com against both, the string or the regex, we wouldn't get a positive match. Therefore, the currently correct way of specifying TPT for this URL would any one of :

Sentry.init({
  tracePropagationTargets: [
     'myapi.com', 
     /^myapi.com/,
     /^myApi.com/i,
]
})

Solution Brainstorm

For simplicity, we propose to convert all entries in tracePropagationTargets .toLower() and add a case insensitivity /i flag to RegExp values.

We're a bit worried though about subtly breaking existing setups that perhaps rely on case sensitivity. Therefore we consider this behaviour-breaking and opt to make the change in the next major.
(Also, intuitively, this sounds like a niche/edge case as it's rather uncommon to capitalize URLs)

Activity

  1. Lms24
    added the
    Improvement
    issue type on Apr 9, 2025
  2. Lms24
    added
    Meta: Breaking
    Package: core
    on Apr 9, 2025
  3. Lms24
    added this to the 10.0.0 milestone on Apr 9, 2025
  4. Lms24
    changed the title [-]Make `tracePropagationTargets` case-insensitive[/-] [+]Make `tracePropagationTargets` matching case-insensitive[/+] on Apr 9, 2025
  5. mydea commented on Apr 9, 2025

    @mydea
    mydea
    on Apr 9, 2025
    Member
    More actions

    We're a bit worried though about subtly breaking existing setups that perhaps rely on case sensitivity.

    How would you depend on this behavior today? I just wonder if there is really a case where we would unintentionally break something vs. it suddenly starting to behave as I want? If a user has configured a trace propagation target myapi.com I find it extremely unlikely that they would expect/depend on requests to myApi.com not being propagated? And on the other hand, if they specifiy myApi.com it is obviously a bug that this will not match anything, basically.

    So my POV is: this is a bug and was never supposed to be case insensitive, so I would just fix it 😅

  6. Lms24 commented on Apr 9, 2025

    @Lms24
    Lms24
    on Apr 9, 2025
    MemberAuthor
    More actions

    I think the concrete concern was places where it's more likely to actually encounter capitalized letters, like query params.

    So maybe something like 'myApi/users?traceRequest=1'

    though now that I think about it, this would only be a problem if we there was a specific all lower case param and a camel-cased version of the same parameter, so rather unlikely?

    The overall concern: Right now, we (unexpectedly) would not attach headers to a variety of requests. Maybe users depend on this inderectly, in the sense that if we changed it, they'd get CORS errors because they didn't realize it was a problem before. So it's kinda a spacebar heating situation xD

  7. mydea commented on Apr 11, 2025

    @mydea
    mydea
    on Apr 11, 2025 – with Linear
    Member
    More actions

    no strong feelings, we can also leave it for v10! I'll leave the decision to you ;)

  8. AbhiPrasad
    self-assigned this
    on Apr 14, 2025
  9. AbhiPrasad
    closed this as completedon Apr 14, 2025
  10. AbhiPrasad commented on Apr 14, 2025

    @AbhiPrasad
    AbhiPrasad
    on Apr 14, 2025
    Contributor
    More actions

    huh I didn't do this 😅

    Linear weirdness?

    Reacted by Lukas Stracke
  11. AbhiPrasad
    reopened this on Apr 14, 2025
  12. AbhiPrasad
    removed their assignment
    on Apr 14, 2025
  13. stephanie-anderson
    removed the
    Improvement
    issue type on Aug 12, 2025
  14. chargome
    added
    Core
    and removed
    Package: core
    on Mar 20, 2026
  15. stephanie-anderson
    added
    Improvement
    on Mar 24, 2026
  16. chargome
    self-assigned this
    on Aug 13, 2026
  17. chargome
    added a commit that references this issue on Aug 25, 2026

    feat(core)!: Make `tracePropagationTargets` matching case-insensitive (…

    This issue will close once commit ee5a772 is merged into the 'develop' branch.
    ee5a772
  18. chargome
    closed this as completedin #23534on Aug 25, 2026
  19. github-actions commented on Sep 23, 2026

    @github-actions
    github-actionsBot
    on Sep 23, 2026 – with GitHub Actions
    Contributor
    More actions

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #23534, which was included in the 11.0.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @chargome
    chargome

Labels

CoreImprovementMeta: Breaking

Projects

No projects

    Milestone

    • 11.0.0No due date

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.