-
-
Notifications
You must be signed in to change notification settings - Fork 88
fix(webfinger): handle domainToASCII in Nodejs & bun #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(webfinger): handle domainToASCII in Nodejs & bun #219
Conversation
|
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 |
|
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. |
94721fe to
d90a913
Compare
In Node.js & Bun, `domainToASCII` return empty string when hostname with port is given (Eg. `localhost:8000`). Fixes: fedify-dev#218
d90a913 to
d3ac8f8
Compare
|
@ThisIsMissEm Added a testcase with |
| rel: "http://webfinger.net/rel/profile-page", | ||
| }, | ||
| { | ||
| href: "https://example.org/@someone", |
There was a problem hiding this comment.
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?
| href: "https://example.org/@someone", | |
| href: "https://example.org:8000/@someone", |
There was a problem hiding this comment.
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".
fedify/src/webfinger/handler.test.ts
Lines 128 to 136 in d3ac8f8
| { | |
| 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?
|
Fixed in Fedify 1.4.7. |
In Node.js & Bun,
domainToASCIIreturn empty string when hostname with port is given (Eg.localhost:8000).Fixes: #218