Skip to content

Commit 24442a5

Browse files
committed
fix urltemplate
1 parent 121e22e commit 24442a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/wotutils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ function normalizeTd(td) {
6363

6464
function formconv(intr, f, affordance) {
6565
if (f.hasOwnProperty("href")) {
66-
f.href = url.resolve(baseUrl, f.href); // decodeURIComponent(url.resolve(baseUrl, f.href));
66+
f.href = url.resolve(baseUrl, f.href)
67+
.replace(/%7B/gi,'{')
68+
.replace(/%7D/gi,'}');
6769
}
6870
if (f.hasOwnProperty("security") && typeof f.security === 'string') {
6971
f.security = [f.security];

templates/webofthings/node.js.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ module.exports = function (RED) {
431431
const urivars = prop.hasOwnProperty("uriVariables") ? msg.payload : {};
432432
if (prop.uriVariables) {
433433
const ajv = new Ajv({allErrors: true});
434-
if (!ajv.validate(prop.uriVariables, urlvars)) {
434+
if (!ajv.validate(prop.uriVariables, urivars)) {
435435
node.warn(`input schema validation error: ${ajv.errorsText()}`, msg);
436436
}
437437
}

0 commit comments

Comments
 (0)