Skip to content

Conversation

danielpeintner
Copy link
Member

'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead n/no-deprecated-api

see #1430

'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead  n/no-deprecated-api
@danielpeintner danielpeintner mentioned this pull request Oct 7, 2025
14 tasks
Comment on lines +222 to +225
query:
requestUri.search && requestUri.search.length > 0 && requestUri.search[0] === "?"
? requestUri.search.substring(1)
: "",
Copy link
Member Author

Choose a reason for hiding this comment

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

It is a bit clumsy since requestUri.search has a leading ? while the old requestUri.query did not have it

?v=6xJ
vs
v=6xJ

@JKRhb please have a look

Copy link
Member

@JKRhb JKRhb Oct 13, 2025

Choose a reason for hiding this comment

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

I think I ran into similar problems a lot time ago, also in node-coap :/ Unfortunately, the URL API is really awful IIRC, both when it comes to query parameters and handling IPv6 addresses. In some aspects, it is also not compliant with RFC 3986 if I am not mistaken, which is one reason I didn't transition to the URL API back in the day.

If I hopefully find the time, I will take a closer look at this PR later this week

Copy link
Member

Choose a reason for hiding this comment

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

I just saw that the goals of the "URL standard" include the following:

Align RFC 3986 and RFC 3987 with contemporary implementations and obsolete the RFCs in the process.

That contributes to quite a frustrating experience when working with "proper" URIs using this API. Therefore, we might need to consider using a different implementation here instead (maybe fast-uri by fastify). Although I am not very happy about that, as I would usually prefer to use the standardized API (if it was actually usable ☹️).

Copy link
Member Author

Choose a reason for hiding this comment

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

I mean, if we fail to use the new libraries, we should stick with what we have...

@danielpeintner
Copy link
Member Author

Mhh, I am not totally sure why it fails on Ubuntu and works on Windows!?

await coapServer.expose(testThing);

const uri = `coap://[::1]:${coapServer.getPort()}/test/`;
const uri = `coap://[::]:${coapServer.getPort()}/test/`;
Copy link
Member Author

Choose a reason for hiding this comment

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

Server started with ::

Copy link
Member Author

Choose a reason for hiding this comment

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

No matter how I change it, it fails on Linux/Mac 🤷‍♂️

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.

2 participants