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 pieh committed Dec 6, 2018
1 parent 8ec4072 commit 6771c0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/create-remote-file-node.js
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 6771c0f

Please sign in to comment.