Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default defineConfig([

"n/no-unsupported-features/node-builtins": "off", // https://github.com/eclipse-thingweb/node-wot/issues/1430
"n/no-extraneous-import": "off", // https://github.com/eclipse-thingweb/node-wot/issues/1430
"n/no-deprecated-api": "off", // https://github.com/eclipse-thingweb/node-wot/issues/1430
"n/no-deprecated-api": "error",
"n/no-unpublished-import": "off", // https://github.com/eclipse-thingweb/node-wot/issues/1430
"n/no-process-exit": "off", // https://github.com/eclipse-thingweb/node-wot/issues/1430
"n/hashbang": "warn",
Expand Down
7 changes: 5 additions & 2 deletions packages/binding-coap/src/coap-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default class CoapClient implements ProtocolClient {
public setSecurity = (metadata: Array<SecurityScheme>): boolean => true;

private uriToOptions(uri: string): CoapRequestParams {
const requestUri = url.parse(uri);
const requestUri = new url.URL(uri);
const agentOptions = this.agentOptions;
agentOptions.type = net.isIPv6(requestUri.hostname ?? "") ? "udp6" : "udp4";
this.agent = new Agent(agentOptions);
Expand All @@ -219,7 +219,10 @@ export default class CoapClient implements ProtocolClient {
hostname: requestUri.hostname ?? "",
port: requestUri.port != null ? parseInt(requestUri.port, 10) : 5683,
pathname: requestUri.pathname ?? "",
query: requestUri.query ?? "",
query:
requestUri.search && requestUri.search.length > 0 && requestUri.search[0] === "?"
? requestUri.search.substring(1)
: "",
Comment on lines +222 to +225
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

observe: false,
multicast: false,
confirmable: true,
Expand Down
Loading