Plumber: @filter cors for DELETE

Created on 3 Apr 2019  路  4Comments  路  Source: rstudio/plumber

The filter mentioned in #143 works for GET requests, but is not active for DELETE. When I convert my DELETE to a (misnomed) GET, everything is fine.

#* @filter cors
cors <- function(res) {
  res$setHeader("Access-Control-Allow-Origin", "*")
  plumber::forward()
}
novice medium help wanted

All 4 comments

@shizidushu workaround in #66 works for me. I leave this issue open nevertheless, because it might help others until an official method is documented.

Hello,

I'm facing issues with CORS requests from chrome to a Plumber API hosted on RSC. I've added the following filter as suggested in the documentation :

* @filter cors

cors <- function(req, res) {
res$setHeader('Access-Control-Allow-Origin', '*')
plumber::forward()
}

But, I'm still getting a 404 status. The API is otherwise working fine with a CURL statement. Has this issue been resolved in 0.4.6 or is there a workaround?

@anv42 Did https://github.com/trestletech/plumber/issues/66#issuecomment-418660334 work for you? If not, please open a new issue on plumber. Thank you.

@schloerke No, #66 (comment) didn't work either. I'll open a new ticket with as much detail into the problem as possible.

Was this page helpful?
0 / 5 - 0 ratings