-
Notifications
You must be signed in to change notification settings - Fork 187
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
fix(core): add new
to url call
#153
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just found an issue with the attribute name. I'll add a test before we cut a release.
@@ -15,7 +15,7 @@ const buildDigestHeader = (username, password, url, method, creds) => { | |||
); | |||
} | |||
|
|||
const path = urllib.URL(url).path; | |||
const path = new urllib.URL(url).path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like path
is not a valid attribute of the URL
object.
> const { URL } = require('url')
undefined
> new URL('https://example.com/test/foo').path
undefined
> new URL('https://example.com/test/foo').pathname
'/test/foo'
We should use pathname
:
const path = new urllib.URL(url).path; | |
const path = new urllib.URL(url).pathname; |
Weird! So did this never work or was it a node 10 change?
On Mon, Feb 3, 2020 at 6:55 PM Chang-Hung Liang ***@***.***> wrote:
***@***.**** approved this pull request.
Just found an issue with the attribute name. I'll add a test before we cut
a release.
------------------------------
In packages/core/src/http-middlewares/before/add-digest-auth-header.js
<#153 (comment)>
:
> @@ -15,7 +15,7 @@ const buildDigestHeader = (username, password, url, method, creds) => {
);
}
- const path = urllib.URL(url).path;
+ const path = new urllib.URL(url).path;
Looks like path is not a valid attribute of the URL object.
> const { URL } = require('url')
undefined
> new URL('https://example.com/test/foo').path
undefined
> new URL('https://example.com/test/foo').pathname
'/test/foo'
We should use pathname:
⬇️ Suggested change
- const path = new urllib.URL(url).path;
+ const path = new urllib.URL(url).pathname;
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#153?email_source=notifications&email_token=AAJMYP5T2SPAMXIBQ23RPLDRBCVGTA5CNFSM4KPMQYO2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCUCO3SQ#pullrequestreview-352644554>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJMYP6NTHC4M2HTB5IDR4DRBCVGTANCNFSM4KPMQYOQ>
.
--
~David Brownman
Platform Engineer | Zapier <https://zapier.com>
c: 303.819.0850
tw: @xavdid
|
🙈 I guess digest auth isn't super popular |
fixes the problem described here
it doesn't look like we've got any testing here, which is why this may have gone undetected so long? I'm also puzzled at why this would have worked at all recently and only broke when we did the godzilla core 8 -> upgrade. In any case, this will fix the issue.