Hey will. Question. On Damus when you make a request for NIP5 to GET that nostr.json…… you guys must include “WWW” in the request url right?

[Is this known already??????]

- If you cURLcertain domain names WITH the “www” (www.domain.com/.well-known/nostr.json) you will get 200 http status code

- If you cURL WITHOUT the “www” (domain.com/.well-known/nostr.json) you might get 308 redirect status code (some servers are configured to redirect the non-www domain to the www domain - pretty common).

anyways, that’s why mine was working here but not there 🙃. After disabling non-www to www redirect no more 308s/301s even Astral shows NIP5 👍

Reply to this note

Please Login to reply.

Discussion

Interesting, so my nip and lightning address is no shown on Damus? (anyone with Damus can check?)

Otherwise I'll change www as well.

Yea, interesting right. I guess when I setup my domain I wanted it to redirect from “domain.com” to “www.domain.com” so it looks consistent in the browser (can’t recall). Either way, that was it!!!

As far as yours, you are good on Damus man

And on “other” shows up to. You’re crystal clear. Cheers

Thanks for checking! so for me the "www" doesn't point anywhere but seems like it's working well on Damus and Astral. Sure it wasn't just a CORS issue?

My lightning address is shown on Damus as well  btw?

When I click ⚡️it shows me lnurl string, yuppp (with wallet popup)

Yea, I am sure I was adamant about it going iteratively.

I was already setting correct header (Access-Control-Allow-Origin: *) before it was working Damus …but not working Astral. So what I did was:

- debugged Astral.ninja in dev tools console which was showing CORS error for my nip5 url

- I copied failing CORS request as cURL

- I replayed/replicated it on my local machine and saw that i'm getting 308 redirect instead of JSON response (realized Astral must be seeing this 308 before it redirects to final json)

- I realized 308 only happens for NON-www on my domain cuz when i try with www i get the json (it’s just the combination for me… since I was BUMPING up all traffic to WWW while astral is calling without www)

- I removed redirect from my domain/server config

- local curl stopped returning 308, instead returned JSON correctly now (non-www)

- Astral got the correct json response on next refresh and it looked legit

That's my experience, I'm not 100% on everything but mine situation required it due to how I had my domain configured (WWW 1st class citizens for me, yours is opposite - makes sense I think then 🤔)

Maybe Damus is smarter and works both ways or somehow deals with that redirect (dunno)… but Astral requests without "www" (which in my case gets redirected, in your case doesn't so you won 🤣).