Skip to content

fix: Fix http PathAndQuery Uri Parsing#2122

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
joe/http-path-and-query-fix
Jun 18, 2026
Merged

fix: Fix http PathAndQuery Uri Parsing#2122
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
joe/http-path-and-query-fix

Conversation

@jkosh44-datadog

Copy link
Copy Markdown
Contributor

What does this PR do?

http version 1.4.1 became stricter in PathAndQuery input parsing to reject all inputs that do not start with /, including empty inputs. Previously, this library passed in an empty input in multiple places when constructing a PathAndQuery. Users are not able to upgrade http past 1.4.0 without this library breaking. This commit fixes the issue by replacing the empty inputs with "/".

Motivation

Fix this library for http versions >= 1.4.1.

Additional Notes

See https://dd.slack.com/archives/C05M4JAM5BJ/p1781552060779329?thread_ts=1781534034.370109&cid=C05M4JAM5BJ

How to test the change?

Existing unit tests should be sufficient, assuming the modified functions have coverage.

@jkosh44-datadog jkosh44-datadog marked this pull request as ready for review June 15, 2026 20:06
@jkosh44-datadog jkosh44-datadog requested a review from a team as a code owner June 15, 2026 20:06
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jun 15, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

semver-check | validate   View in Datadog   GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 73.07% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: fdc623d | Docs | Datadog PR Page | Give us feedback!

@jkosh44-datadog jkosh44-datadog changed the title Fix http PathAndQuery Uri Parsing fix: Fix http PathAndQuery Uri Parsing Jun 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/joe/http-path-and-query-fix

Summary by Rule

Rule Base Branch PR Branch Change
unwrap_used 7 7 No change (0%)
Total 7 7 No change (0%)

Annotation Counts by File

File Base Branch PR Branch Change
libdd-common/src/connector/named_pipe.rs 1 1 No change (0%)
libdd-common/src/lib.rs 6 6 No change (0%)

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 5 5 No change (0%)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 21 21 No change (0%)
datadog-live-debugger 4 4 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-sidecar 46 46 No change (0%)
libdd-common 13 13 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-data-pipeline 5 5 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-remote-config 3 3 No change (0%)
libdd-telemetry 20 20 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 3 3 No change (0%)
libdd-trace-stats 1 1 No change (0%)
libdd-trace-utils 12 12 No change (0%)
Total 182 182 No change (0%)

About This Report

This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79271436c9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread libdd-common/src/lib.rs
@dd-octo-sts

dd-octo-sts Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.70 MB 7.70 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 83.67 MB 83.67 MB +0% (+256 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 94.77 MB 94.77 MB +0% (+240 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.34 MB 10.34 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 24.83 MB 24.83 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 87.33 KB 87.33 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 180.86 MB 180.86 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 925.02 MB 925.02 MB +0% (+306 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.09 MB 8.09 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 87.33 KB 87.33 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 23.94 MB 23.94 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 47.78 MB 47.78 MB +0% (+16 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 21.52 MB 21.52 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 88.71 KB 88.71 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 184.88 MB 184.87 MB -0% (-16.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 917.97 MB 917.97 MB +0% (+292 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.24 MB 6.24 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 88.71 KB 88.71 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 25.66 MB 25.66 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 45.41 MB 45.41 MB +0% (+12 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 74.59 MB 74.59 MB +0% (+64 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.58 MB 8.58 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 90.02 MB 90.02 MB +0% (+184 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.44 MB 10.44 MB 0% (0 B) 👌

`http` version 1.4.1 became stricter in `PathAndQuery` input parsing to
reject all inputs that do not start with `/`, including empty inputs.
Previously, this library passed in an empty input in multiple places
when constructing a `PathAndQuery`. Users are not able to upgrade `http`
past 1.4.0 without this library breaking. This commit fixes the issue by
replacing the empty inputs with `"/"`.
@jkosh44-datadog jkosh44-datadog force-pushed the joe/http-path-and-query-fix branch from 7927143 to fdc623d Compare June 16, 2026 12:11

@danielsn danielsn 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.

Otherwise LGTM

.scheme("windows")
.authority(path)
.path_and_query("")
.path_and_query("/")

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.

is this correct for windows?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think so. If you look at the code, it's explicitly expecting the first byte to be b'/', and I don't see any cfg flags based on OS.

https://docs.rs/http/latest/src/http/uri/path.rs.html#427-429

Here's the full path of path_and_query():

I see that there's two tests at the bottom of this file that call this function, are they run on Windows? If so, is that sufficient to gain confidence that it's correct on Windows? If not, is there any additional test we can add?

I'm not super familiar with this code base or with windows so it's hard for me to say with a high level of certainty if it's correct or not.

@morrisonlevi morrisonlevi 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.

Have you manually tested unix domain sockets at all? I think that this probably is fine but it's one of those things I think is worth testing end-to-end. If you want help, I can show you how to do this for dd-trace-php.

@jkosh44-datadog

Copy link
Copy Markdown
Contributor Author

Have you manually tested unix domain sockets at all? I think that this probably is fine but it's one of those things I think is worth testing end-to-end. If you want help, I can show you how to do this for dd-trace-php.

@morrisonlevi I have not manually tested it, and yes I would appreciate if you could show me how. I have not done any manual testing and have been leaning on CI fully for validation.

@jkosh44-datadog

Copy link
Copy Markdown
Contributor Author

Have you manually tested unix domain sockets at all? I think that this probably is fine but it's one of those things I think is worth testing end-to-end. If you want help, I can show you how to do this for dd-trace-php.

@morrisonlevi I have not manually tested it, and yes I would appreciate if you could show me how. I have not done any manual testing and have been leaning on CI fully for validation.

@morrisonlevi bump, how can I test the unix domain sockets end-to-end?

@paullegranddc paullegranddc 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.

For the data-pipeline crates, this looks correct to me.
The authority get's decoded all the same for unix socket/windows piped and the path_and_query part of the URL is replaced to talk to specific endpoints

@paullegranddc

Copy link
Copy Markdown
Contributor

Have you manually tested unix domain sockets at all?

We do have integration tests using UDS in the trace exporter https://github.com/DataDog/libdatadog/blob/main/libdd-data-pipeline/tests/test_trace_exporter.rs#L345C14-L345C31

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit e746d26 into main Jun 18, 2026
90 of 94 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the joe/http-path-and-query-fix branch June 18, 2026 15:43
iunanua added a commit that referenced this pull request Jun 19, 2026
# Release proposal for libdd-remote-config and its dependencies

This PR contains version bumps based on public API changes and commits
since last release.

## libdd-common
**Next version:** `5.0.0`
**Semver bump:** `major`
**Tag:** `libdd-common-v5.0.0`

### Commits

- chore(profiling): Use SECURITY_ANONYMOUS when connecting to named pipe
server (#2134)
- fix: Fix http PathAndQuery Uri Parsing (#2122)
- chore(common)!: replace native-certs with platform-verifier (#2078)
- feat(data-pipeline)!: CSS Trace Filters (#1985)
- fix(libdd-common): Add fallback logic for resolving Azure Functions
instance name [SVLS-8931] (#2077)
- test: fix timeouts on heavily contended scenarios (#2093)

## libdd-remote-config
**Next version:** `1.0.0`
**Semver bump:** `major`
**Tag:** `libdd-remote-config-v1.0.0`

**Warning:** this is an initial release. Please verify that the version
and commits included are correct.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: iunanua <18325288+iunanua@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants