[wp-trac] [WordPress Trac] #46381: WordPress multisite API CORS issue with headers (v5)

WordPress Trac noreply at wordpress.org
Fri Mar 1 00:14:13 UTC 2019


#46381: WordPress multisite API CORS issue with headers  (v5)
--------------------------+-----------------------------
 Reporter:  kacalica      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:
 Severity:  major         |   Keywords:
  Focuses:  rest-api      |
--------------------------+-----------------------------
 When trying to call the API for posts in the new WordPress version I keep
 getting this error.

 {{{
 Access to fetch at 'http://XXX.XXX.XXX.XX/firstcivdivcareers/wp-
 json/wp/v2/posts/' from origin 'http://localhost:9000' has been blocked by
 CORS policy: Response to preflight request doesn't pass access control
 check: Redirect is not allowed for a preflight request.
 }}}

 Happens even when I include the headers manually through the functions.php
 in the theme.


 https://stackoverflow.com/questions/54890718/multisite-wordpress-api-cors-
 issue-with-headers-set-in-theme-v5

 Originally, I believed I was doing something wrong but exhausted all
 options and realized it's not my multisite configuration after starting
 from a single site and doing a fresh install with no changes.

 API should be callable otherwise it's not a useful. So I believe this is a
 bug due to the new upgrade in version 5. If it is I suspect plugins and
 sites which use the API will be breaking so I set this to major but not
 severe.

 Adding my original SO question here for more details:
 https://stackoverflow.com/questions/54890718/multisite-wordpress-api-cors-
 issue-with-headers-set-in-theme-v5

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46381>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list