You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Here's the log entry I kept. Domain and OS username have been sanitized, everything else is original: {"0":"Raw Host header: \\MYDOMAIN","_meta":{"runtime":"Nodejs","runtimeVersion":"v21.7.3","hostname":"nostrcheck","date":"2024-12-05 17:54:08","logLevelId":2,"logLevelName":"DEBUG","path":{"fullFilePath":"/home/OSUSER/nostrcheck-server/src/controllers/nostraddress.ts:14:12","fileName":"nostraddress.ts","fileNameWithLine":"nostraddress.ts:14","fileColumn":"12","fileLine":"14","filePath":"/src/controllers/nostraddress.ts","filePathWithLine":"/src/controllers/nostraddress.ts:14","method":"getNostraddress"}}}
It might be related to the Nginx configuration. Could you check and let me know what value $host has in your Nginx setup? That could help narrow it down.
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, orUSERNAME is not found on MYDOMAIN
upon failure (note no double backslashes before the domain).Additional context
$host
req.hostname
on line 22 of nostraddress.ts results in successful NIP-05 GET response.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 andreq.hostname
?const servername = (req.headers.host || "").replace(/^[\\]+/, "").trim();
cleans the double backslashes. Am currently using this as a workaround.The text was updated successfully, but these errors were encountered: