Skip to content

Conversation

@revathskumar
Copy link
Contributor

In Node.js & Bun, domainToASCII return empty string when hostname with port is given (Eg. localhost:8000).

Fixes: #218

@ThisIsMissEm
Copy link
Contributor

Could you also add a test case for a valid hostname like example.com, but with a port? I'm wondering if that is handled incorrectly at the moment too. The webfinger spec doesn't mention anything about handling ports / domains: https://datatracker.ietf.org/doc/html/rfc7033

This test also doesn't test for what it says it does: https://github.com/fedify-dev/fedify/blame/94721fe927df0cbf105f053783552481b9979e39/src/webfinger/handler.test.ts#L278 (both resources are https: instead of http:, though it does test not found behaviour

@dahlia
Copy link
Member

dahlia commented Mar 19, 2025

Thank you for reporting #218 and debugging this! As it should be applied to previous versions (1.4.x), I'm going to make a separate patch to fix it.

@revathskumar revathskumar force-pushed the fix-webfinger-on-localhost branch from 94721fe to d90a913 Compare March 19, 2025 15:29
In Node.js & Bun, `domainToASCII` return empty string when hostname with
port is given (Eg. `localhost:8000`).

Fixes: fedify-dev#218
@revathskumar revathskumar force-pushed the fix-webfinger-on-localhost branch from d90a913 to d3ac8f8 Compare March 19, 2025 15:33
@revathskumar
Copy link
Contributor Author

revathskumar commented Mar 19, 2025

@ThisIsMissEm Added a testcase with http://example.com:8000 for hostname with port.

rel: "http://webfinger.net/rel/profile-page",
},
{
href: "https://example.org/@someone",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you missed one?

Suggested change
href: "https://example.org/@someone",
href: "https://example.org:8000/@someone",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThisIsMissEm I left it intentionally assuming that it's alternate url and not based on actorUri
for the other testcase "localhost with port", I left it as "example.org".

{
href: "https://localhost:8000/@someone",
rel: "http://webfinger.net/rel/profile-page",
},
{
href: "https://example.org/@someone",
rel: "alternate",
type: "text/html",
},

Do I need to make change in both places?

@dahlia dahlia closed this in 716db0f Mar 19, 2025
@dahlia
Copy link
Member

dahlia commented Mar 19, 2025

Fixed in Fedify 1.4.7.

@revathskumar revathskumar deleted the fix-webfinger-on-localhost branch March 19, 2025 18:04
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.

.well-known/webfinger endpoint thows 404 on localhost

3 participants