Skip to content

Commit ea407dd

Browse files
committed
Support http-basic-auth via basicAuth setting
use settings.basicAuth.username and settings.basicAuth.password to configure basic authentication.
1 parent 5f051d8 commit ea407dd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/wordpress.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ function Client( settings ) {
4444
// via settings.host
4545
headers: {
4646
Host: parsedUrl.host
47-
}
47+
},
48+
basic_auth: settings.basicAuth ? {
49+
user: settings.basicAuth.username,
50+
pass: settings.basicAuth.password
51+
} : null,
4852
});
4953
this.blogId = settings.blogId || 0;
5054
this.username = settings.username;

0 commit comments

Comments
 (0)