Skip to content

Commit 57fdcbd

Browse files
Copilotkraftbj
andauthored
VideoPress: fix admin-ajax URL handling with @wordpress/api-fetch in GutenbergKit (#47242)
* Initial plan * fix: always use `url` option for admin-ajax requests in apiFetch Co-authored-by: kraftbj <88897+kraftbj@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kraftbj <88897+kraftbj@users.noreply.github.com>
1 parent 5d53688 commit 57fdcbd

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • projects/packages/videopress/src/client/lib/get-media-token

projects/packages/videopress/src/client/lib/get-media-token/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ const requestMediaToken = function (
9494

9595
const fetchPromise: Promise< Response > = useApiFetch
9696
? window.wp.apiFetch( {
97-
...( /^https?:\/\//.test( adminAjaxAPI )
98-
? { url: adminAjaxAPI }
99-
: { path: adminAjaxAPI } ),
97+
url: adminAjaxAPI,
10098
...fetchOptions,
10199
parse: false,
102100
} )

0 commit comments

Comments
 (0)