Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sitemap could not be loaded: pa11y-ci with --sitemap and proxy #207

Open
keraldi opened this issue Jun 3, 2023 · 1 comment
Open

Sitemap could not be loaded: pa11y-ci with --sitemap and proxy #207

keraldi opened this issue Jun 3, 2023 · 1 comment

Comments

@keraldi
Copy link

keraldi commented Jun 3, 2023

pa11y-ci cannot fetch a sitemap if a proxy is required to access it.

It seems that the call to fetch the sitemap from a remote location does not consider a proxy.

Tested behind VPN + Proxy; proxy setting works without --sitemap, but not with --sitemap.
I could not evaluate whether or not it would be able to fetch a sitemap behind HTTP Basic Auth but I assume it would be ignored, too, as the respective line only issues a simple .then(() => fetch(sitemapUrl)).

Example configuration:

pa11y_config.js

module.exports = {
   defaults: {
      chromeLaunchConfig: {
         args: [
            '--proxy-server=127.0.0.1:9999',
         ]
      }
   }
}

Example command:

pa11y-ci --config pa11y_config.js -s https://pa11y.org/sitemap.xml (behind VPN with required outgoing proxy)

@heiko-hardt
Copy link

Same issue here. It looks like the default node-fetch module doesn't support proxy. I hope this will be added sometimes.

My current workaround was requiring a small wrapper library (https://github.com/formio/node-fetch-http-proxy) and replacing the 'node-fetch' module with '@formio/node-fetch-http-proxy'. Works like expected using environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants