Skip to content

Commit a8cdd2c

Browse files
swissspidyclaude
andauthored
Use GET request to download theme from underscores.me (#398)
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. Claude-Session: https://claude.ai/code/session_013rF1yyKWPmtBrXEVSrPJUW Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5aa3fdb commit a8cdd2c

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)