Skip to content

feat(http): build absolute request URL from relay_url - #725

Merged
Anshumancanrock merged 4 commits into
cameri:mainfrom
Anshumancanrock:feat/nip98-http-url
Aug 13, 2026
Merged

feat(http): build absolute request URL from relay_url#725
Anshumancanrock merged 4 commits into
cameri:mainfrom
Anshumancanrock:feat/nip98-http-url

Conversation

@Anshumancanrock

Copy link
Copy Markdown
Collaborator

Description

This PR adds getAbsoluteHttpRequestUrl() so callers can build the absolute HTTP URL that clients must sign in NIP-98 u, using scheme + host from info.relay_url only (not the request Host header).

Path still uses the existing public path prefix rules (x-forwarded-prefix from a trusted proxy, else relay_url pathname) plus request.url.

No admin middleware or Redis changes in this PR.

Related Issue

Prerequisite for NIP-98 admin API auth (follows #722 verifier). Next: Redis SET NX, then admin middleware.

Motivation and Context

NIP-98 binds the signed u tag to the request URL. If scheme/host came from the client Host header, an attacker could spoof it. Pinning to info.relay_url keeps URL binding operator-controlled.

@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7d75692

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coveralls

coveralls commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 69.841% (+0.09%) from 69.749% — Anshumancanrock:feat/nip98-http-url into cameri:main

@Anshumancanrock
Anshumancanrock requested a review from cameri August 12, 2026 08:00
@Anshumancanrock
Anshumancanrock merged commit 849c3f7 into cameri:main Aug 13, 2026
16 of 17 checks passed
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.

3 participants