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 (gatsbyjs#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 gpetrioli committed Jan 22, 2019
1 parent 3789b53 commit 43e6671
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 43e6671

Please sign in to comment.