Comments (3)
Ah yes the issue is with your config. The config should be an exported object rather than JS code which runs with Pa11y. The following may work for you:
const credentials = 'mycredential:mypassword';
const encodedCredentials = new Buffer(credentials).toString('base64');
module.export = {
defaults: {
headers: {
Authorization: `Basic ${encodedCredentials}`
}
},
urls: [
'https://my.example.com'
]
};
I'm going to close the issue, but let me know if this doesn't help!
from pa11y-ci.
@rowanmanning
Thank you for replying. Unfortunately, i'm getting the same 401 error.
Couple ways I configured config.js file is
1. The way you suggested, replacing "mycredential", "mypassword", and "urLs" accordingly.
const credentials = 'mycredential:mypassword';
const encodedCredentials = new Buffer(credentials).toString('base64');
module.export = {
defaults: {
headers: {
Authorization: Basic ${encodedCredentials}
}
},
urls: [
'https://my.example.com'
]
};
2. I also tried base 64ing the credential and commenting out two const at the top
//const credentials = '1000000003:dev1234$$';
//const encodedCredentials = new Buffer(credentials).toString('base64');
module.export = {
defaults: {
headers: {
Authorization: 'Basic hashed_credential'
}
},
urls: [
'https://myurl'
]
};
Both returns 401. In addition, I have noticed if i just run $pa11y-ci -c config.js, it doesn't pick up the url specified in the config. I have to specify the url in command line for pa11y to test against it for some reason i.e. $pa11y-ci -c config.js https://myurl.com
Thank you for the assistance !
from pa11y-ci.
Typo in the sample answer at s/module.export
/module.exports
but this helped!
Create some file, like pa11y-config.js
:
const credentials = 'mycredential:mypassword';
const encodedCredentials = new Buffer(credentials).toString('base64');
module.exports = {
defaults: {
headers: {
Authorization: `Basic ${encodedCredentials}`
}
},
urls: [
'https://my.example.com'
]
};
Run
pa11y-ci --config=./pa11y-config.js
from pa11y-ci.
Related Issues (20)
- Update pa11y dependency to allow minor updates
- Notices not included when running from command line HOT 1
- request: add action(s) to write text to console HOT 5
- pa11y headers configuration problem HOT 2
- Using `--sitemap-exclude` command-line option. HOT 1
- Feature request: Support full error messages in getUrlsFromSitemap
- How do you output HTML results? HOT 4
- Using Cookies or useIncognitoBrowserContext in Pa11y-ci HOT 1
- Timeout is ignored - wait for element HOT 1
- Debug sitemap mode HOT 1
- Option to pass environment variable in .pa11yci file HOT 4
- Support for large sitemaps when sitemap.xml is using sitemap index files HOT 4
- Prepending base URL HOT 6
- Failing to run on ubuntu-22.04 HOT 4
- add support for xpath based locators
- Support for wait for network call
- WCAG 2.1 and 2.2 HOT 1
- Pa11y-ci support for WCAG 2.2 HOT 5
- Sitemap could not be loaded: pa11y-ci with --sitemap and proxy
- HTML reporters are unable to load HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pa11y-ci.