Skip to content

Drop unused path parameter from URLRequest initializer#321

Merged
3lvis merged 4 commits into
masterfrom
remove-dead-urlrequest-path-param
Jun 18, 2026
Merged

Drop unused path parameter from URLRequest initializer#321
3lvis merged 4 commits into
masterfrom
remove-dead-urlrequest-path-param

Conversation

@3lvis

@3lvis 3lvis commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What

The custom URLRequest.init(url:requestType:path:contentType:…) declared path _: String and discarded it, yet both call sites (requestData, createRequest) threaded a path: argument through it. Removes the dead parameter from the initializer and both call sites.

Why

Surfaced during a dead-code sweep. The parameter carried no information into the request — the URL is already built before the init is called. Removing it is behavior-neutral.

Verification

  • swift build and swift build --build-tests clean.
  • 52 server-free offline tests pass (integration suites need Docker/go-httpbin).

3lvis added 4 commits June 17, 2026 23:28
- objectFromCache: a file vanishing between exists() and read (background
  sweep race) is now a cache miss, not a fatalError; inline the single-use
  URL.getData() helper that held the crash.
- splitBaseURLAndRelativePath: return optional instead of fatalError on
  unparseable input (breaking: public API now returns an optional tuple).
@3lvis 3lvis marked this pull request as ready for review June 18, 2026 09:41
@3lvis 3lvis merged commit 2049253 into master Jun 18, 2026
1 check passed
@3lvis 3lvis deleted the remove-dead-urlrequest-path-param branch June 18, 2026 09:42
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