1.0.0-beta10 produces ReferenceError: URL is not defined.
Here is the proposed fix which seems to work for me in:
jwt.interceptor.ts
const URL = require('url');
// inside isWhitelistedDomain method
isWhitelistedDomain(request: HttpRequest<any>): boolean {
// const requestUrl = new URL(request.url);
const requestUrl = URL.parse(request.url, false, true);
...
I have an issue as well. This is a regression.
I cannot use relative URL to my backend anymore.
It throws an error:
TypeError: Failed to construct 'URL': Invalid URL
It was working fine on 1.0.0-beta.9.
I will stick to the older version for now...
@merlosy - please see #477 for relative URL discussion and possible security implications / workarounds.
@chenkie I was hoping this fix would make it into 1.0.0. Can you please prioritize this (it's a one-liner).
Thanks.
@merlosy this isn't regression, it's simply a bug that was avoided by handling the error that throw. By removing the try catch in beta10 made this error showed up. In beta9 iswhitelisted is always true when your use "undefined" url (partial). Your solution seems to work @noomaans, you should create a pr.
PR submitted.
Thanks @chenkie
Most helpful comment
PR submitted.