fix: GSC submit_sitemap — scope and Content-Length bugs#656
Merged
Conversation
…ontent-Length header Two bugs prevented submit_sitemap from working: 1. OAuth scope was webmasters.readonly which blocks write operations with HTTP 403. Changed to webmasters (read-write), which still covers all existing read operations. 2. The PUT request sent an empty body without a Content-Length: 0 header, causing the GSC API to return HTTP 411 Length Required. Added the missing header.
Homeboy Results —
|
There was a problem hiding this comment.
Homeboy Failure Digest
Failure Digest
Tooling versions
- Homeboy CLI: homeboy 0.58.1
- Extension: wordpress from
https://github.com/Extra-Chill/homeboy-extensions - Extension revision:
unknown - Action:
Extra-Chill/homeboy-action@v1
Autofixability classification
- Overall: none
- Autofix enabled: no
- Autofix attempted this run: no
- No failed commands to classify.
- Autofix is currently disabled. Commands with autofix support in this run:
audit
Machine-readable artifacts
homeboy-test-failures.jsonhomeboy-audit-summary.jsonhomeboy-autofixability.json
There was a problem hiding this comment.
Homeboy Failure Digest
Failure Digest
Tooling versions
- Homeboy CLI: homeboy 0.58.1
- Extension: wordpress from
https://github.com/Extra-Chill/homeboy-extensions - Extension revision:
unknown - Action:
Extra-Chill/homeboy-action@v1
Autofixability classification
- Overall: none
- Autofix enabled: no
- Autofix attempted this run: no
- No failed commands to classify.
- Autofix is currently disabled. Commands with autofix support in this run:
lint,test
Machine-readable artifacts
homeboy-test-failures.jsonhomeboy-audit-summary.jsonhomeboy-autofixability.json
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two bugs that prevented the
submit_sitemapaction from working in the Google Search Console ability:webmasters.readonly, which blocks write operations (HTTP 403 "insufficient authentication scopes"). Changed towebmasters(read-write), which is a superset that still covers all existing read operations.'') without aContent-Length: 0header, causing the GSC API to return HTTP 411 "Length Required". Added the header.Also deleted the cached
datamachine_gsc_access_tokentransient on the live site so the next request will fetch a new token with the correct scope.Changes
inc/Abilities/Analytics/GoogleSearchConsoleAbilities.php:webmasters.readonly→webmasters'Content-Length' => '0'to the PUT request headers