CallBuilder._requestFnForLink calls expandUriTemplate(link.href, opts) without its optional third argument, baseUrl. With no base, new URL(expanded, undefined) throws, so every templated link function on a record whose _links are relative fails with TypeError: Invalid URL. The non-templated branch on the next line passes this.url and resolves the same href correctly.
- uri = new URL(expandUriTemplate(link.href, opts), this.url);
+ uri = new URL(expandUriTemplate(link.href, opts, this.url), this.url);
expandUriTemplate returns an absolute string, so the outer new URL() no longer needs its second argument.
Relative templated hrefs appear in the account-records fixture in test/unit/server/horizon/server.test.ts, but no test calls a link function on one.
CallBuilder._requestFnForLinkcallsexpandUriTemplate(link.href, opts)without its optional third argument,baseUrl. With no base,new URL(expanded, undefined)throws, so every templated link function on a record whose_linksare relative fails withTypeError: Invalid URL. The non-templated branch on the next line passesthis.urland resolves the same href correctly.expandUriTemplatereturns an absolute string, so the outernew URL()no longer needs its second argument.Relative templated hrefs appear in the account-records fixture in
test/unit/server/horizon/server.test.ts, but no test calls a link function on one.