Skip to content

Commit 1d4e057

Browse files
brxckpieh
authored andcommitted
fix(gatsby-source-filesystem): allow empty password for basic auth in 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)).
1 parent 850e18c commit 1d4e057

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/gatsby-source-filesystem/src/create-remote-file-node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ async function processRemoteNode({
188188

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

0 commit comments

Comments
 (0)