-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix error when a sitemap path starts with //
When creating a Psr7 request with a base_uri set in the Client and a path that starts with // (like '//wp-sitemap.xml'), the path is interpreted as an absolute URL and we get a ClientException for 'unknown host: wp-sitemap.xml'. This is fixed by removing base_uri from the client and always making Requests with the full url. This was discovered while debugging #824 and may address that issue.
- Loading branch information
1 parent
10ba290
commit bbc8abb
Showing
2 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bbc8abb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
John,
Thank you for the update. Unfortunately, this commit version still fails with the same symptoms as before.
I did verify on the system that the correct code was pushed out.
bbc8abb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
John,
Also note, I was able to duplicate the same issue with a fresh Lokl install and installing just the RankMath SEO WP plugin.
Then I removed the wp2static and installed the updated commit version and the problem/error was the same.
However, in looking at the error log on the system, it appears to be a different error on the Lokl instance.
This not be as relevant as just having the RankMath plugin activated produces that error (after deactivating the plugin's functionality after install), so the behavior is different than on my original test docker instance. I am doing some more testing on the lokl instance.
bbc8abb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhatmaker I replicated the
TooManyRedirects
error and opened #826 with a fix.Can you please try that code and see if you're still getting the original 500 error due to
//
? I'm unable to replicate that error in a fresh WP install on Loklbbc8abb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bookwyrm - Thanks! I will give that a try. I did increment the max in the allow_redirects in the Crawler (from your commit/PR) which allowed the static site to be generated. But I will pull the full codebase again and run it through, but I suspect it is good.