-
Notifications
You must be signed in to change notification settings - Fork 270
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
Crawling sites with basic auth fails authorization #844
Labels
Comments
This was referenced Mar 3, 2022
john-shaffer
pushed a commit
to thecodeassassin/wp2static
that referenced
this issue
Mar 19, 2022
This is fixed in develop now. Thanks, @vladstanca and @thecodeassassin! |
@john-shaffer when is this going to be released? all my exported pages, i get Unauthorized message. |
answered in #873 |
furmanOFF
pushed a commit
to furmanOFF/wp2static
that referenced
this issue
Nov 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a site is behind basic auth, the resulting static site just has the failed authorization error for every page.
To Reproduce
Steps to reproduce the behavior:
Environment (please complete the following information):
Additional context
From what I could find, the issue is with the headers. I fond the following:
The plugin uses code similar to this in Crawler & SitemapParser & DetectSitempasURLs
new Request()
expects actual headers, soAuthorization: Basic ###
, but the code above is formatted for client options.Using
$response = $this->client->request( 'GET', $url, $headers );
works because the expected 3rd argument is $options and the format of the $headers is['auth' => ['user', 'pass']]
.In my local copy I was able to get it working by making those changes and also changing DetectSitemapsURLs::detect() to pass in the guzzle options to SitemapParser.
These changes seemed to work fine on one site, but on another site the plugin kept failing saying wp-sitemap.xml was not found. So i didn't feel comfortable submitting a pull request, but I hope this helps.
The text was updated successfully, but these errors were encountered: