diff --git a/packages/binding-http/src/http-server.ts b/packages/binding-http/src/http-server.ts index d8c00b536..60aed833b 100644 --- a/packages/binding-http/src/http-server.ts +++ b/packages/binding-http/src/http-server.ts @@ -307,9 +307,8 @@ export default class HttpServer implements ProtocolServer { private addUrlRewriteEndpoints(form: TD.Form, forms: Array): void { if (this.urlRewrite) { - for (const inUri in this.urlRewrite) { - const toUri = this.urlRewrite[inUri]; - if (form.href.endsWith(toUri)) { + for (const [inUri, toUri] of Object.entries(this.urlRewrite)) { + if (toUri != null && form.href.endsWith(toUri)) { const form2: TD.Form = JSON.parse(JSON.stringify(form)); // deep copy form2.href = form2.href.substring(0, form.href.lastIndexOf(toUri)) + inUri; forms.push(form2);