Skip to content

Commit d2f2dc1

Browse files
committed
Use GET request to download theme from underscores.me
underscores.me now responds with 403 to all POST requests, but still serves the generated theme zip when the same form fields are passed as query arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013rF1yyKWPmtBrXEVSrPJUW
1 parent 5aa3fdb commit d2f2dc1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/Scaffold_Command.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,15 +412,15 @@ public function underscores( $args, $assoc_args ) {
412412
$body['underscoresme_woocommerce'] = 1;
413413
}
414414

415-
$tmpfname = wp_tempnam( $url );
416-
$post_args = [
415+
$tmpfname = wp_tempnam( $url );
416+
$request_args = [
417417
'timeout' => $timeout,
418-
'body' => $body,
419418
'stream' => true,
420419
'filename' => $tmpfname,
421420
];
422421

423-
$response = wp_remote_post( $url, $post_args );
422+
// underscores.me rejects POST requests, but accepts the same form fields as query args.
423+
$response = wp_remote_get( add_query_arg( urlencode_deep( $body ), $url ), $request_args );
424424

425425
if ( is_wp_error( $response ) ) {
426426
WP_CLI::error( $response );

0 commit comments

Comments
 (0)