Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Janitor proxy is broken: TypeError [ERR_INVALID_URL]: Invalid URL #405

Open
jankeromnes opened this issue Dec 4, 2018 · 1 comment
Open

Comments

@jankeromnes
Copy link
Member

When upgrading Palmaria and Pianosa to 221311f (and Node 10), we get this error in the authentication flow:

(node:15527) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_URL]: Invalid URL: /abcdef0123456789/8089/ide.html?code=1234567890&state=1234567890
    at onParseError (internal/url.js:240:17)
    at parse (internal/url.js:249:3)
    at new URL (internal/url.js:324:5)
    at Array.handleOAuth2Code (/home/jan/janitor/join.js:138:22)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15527) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15527) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Looks like you can't do new URL(request.url), because request.url is something like /index.html while new URL() seems to expect something like http://domain.com/index.html.

Hot-fixed in production by reverting the latest commit on Palmaria and Pianosa.

Cc @nt1m please have a look when you have time. 😄

@nt1m
Copy link
Member

nt1m commented Dec 4, 2018

@jankeromnes You can do new URL(request.url, baseURL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants