Skip to content

Commit

Permalink
fix(gatsby-source-filesystem): allow empty password for basic auth in…
Browse files Browse the repository at this point in the history
… createRemoteFileNode (#10280)

This allows createRemoteFileNode authentication with either user or password. Currently auth params with falsy keys are ignored, but not all authentication schemes require both user and password (e.g. [Stripe API](https://stripe.com/docs/api/authentication?lang=curl)).
  • Loading branch information
brxck authored and pieh committed Dec 6, 2018
1 parent 850e18c commit 1d4e057
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ async function processRemoteNode({

// Add htaccess authentication if passed in. This isn't particularly
// extensible. We should define a proper API that we validate.
if (auth && auth.htaccess_pass && auth.htaccess_user) {
if (auth && (auth.htaccess_pass || auth.htaccess_user)) {
headers.auth = `${auth.htaccess_user}:${auth.htaccess_pass}`
}

Expand Down

0 comments on commit 1d4e057

Please sign in to comment.