Skip to content

Reject empty ids instead of dropping their request path segment - #114

Merged
smejl merged 1 commit into
mainfrom
reject-empty-ids-in-request-paths
Nov 4, 2026
Merged

smejl merged 1 commit into
mainfrom
reject-empty-ids-in-request-paths

Conversation

@smejl

@smejl smejl commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #111. An id that is empty or whitespace-only was sent as no path segment at all: buildUrl drops an empty encoded path, so /v3/users/{id} became /v3/users (the collection route), and identify('') is validated nowhere. It is the same class of problem as the . and .. ids that #111 rejects.

The guard in RequestConfiguratorImpl.encodePathSegment now also rejects an id that trims to nothing, with QonversionErrorCode.InvalidArgument and a fixed message; a.b, ...x and other ordinary ids are encoded as before. The enum member's comment names the empty id as well.

Tests: the existing dot-id case table gains '' and ' ', checked against all six id-taking request builders.

Verified locally with Node 22.23.4 / Yarn 1.22.22: yarn lint, yarn build, yarn test (29 suites, 287 tests).

🤖 Generated with Claude Code

An id that is empty or whitespace-only produced the collection route
(for example /v3/users instead of /v3/users/{id}), because buildUrl
drops an empty encoded path and identify('') is validated nowhere. The
same guard that rejects "." and ".." now rejects an id that trims to
nothing, with QonversionErrorCode.InvalidArgument.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml; Enforced overrides: Organization
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 51a119ba-a09a-4881-8dac-7d45ed8e061e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@smejl
smejl merged commit e3c5a30 into main Nov 4, 2026
4 checks passed
@smejl
smejl deleted the reject-empty-ids-in-request-paths branch November 4, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants