Skip to content

nostraddress / NIP-05 failing #33

Open
@tnperron

Description

@tnperron

Describe the bug
nostraddress / NIP-05 GET request failing with USERNAME is not found on \\MYDOMAIN. Noted the presence of double backslashes before the domain.

To Reproduce
Steps to reproduce the behavior:
Send GET request to https://MYDOMAIN/api/v2/nostraddress?name=USERNAME via browser.

Expected behavior
A return of NIP-05 standard response of names: USERNAME: HEXNPUB upon success, or USERNAME is not found on MYDOMAIN upon failure (note no double backslashes before the domain).

Additional context

  • nostrcheck-server 0.6.0 set up via install.sh script on Ubuntu Server 24.04.1 LTS
  • Nginx debug logs reported a correct $host
  • Hard-coding domain in place of req.hostname on line 22 of nostraddress.ts results in successful NIP-05 GET response.
  • Adding logger.debug('Raw req.headers.host: ${req.headers.host}'); after line 22 in nostraddress.ts logs header showing double backslashes before the domain. Seems to suggest double backslashes are being added somewhere between Nginx and req.hostname?
  • Replacing line 22 in nostraddress.ts with const servername = (req.headers.host || "").replace(/^[\\]+/, "").trim(); cleans the double backslashes. Am currently using this as a workaround.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions