Skip to content

Commit

Permalink
Enable HTTP PATCH support in evhttp_server
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 381145934
  • Loading branch information
tensorflower-gardener authored and tensorflow-copybara committed Jun 24, 2021
1 parent ceba636 commit 6cbc4a9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ bool EvHTTPServer::Initialize() {
}

// By default libevents only allow GET, POST, HEAD, PUT, DELETE request
// we have to manually turn OPTIONS flag on
// documentation:
// we have to manually turn OPTIONS and PATCH flag on documentation:
// (http://www.wangafu.net/~nickm/libevent-2.0/doxygen/html/http_8h.html)
evhttp_set_allowed_methods(
ev_http_, EVHTTP_REQ_GET | EVHTTP_REQ_POST | EVHTTP_REQ_HEAD |
EVHTTP_REQ_PUT | EVHTTP_REQ_DELETE | EVHTTP_REQ_OPTIONS);
EVHTTP_REQ_PUT | EVHTTP_REQ_DELETE | EVHTTP_REQ_OPTIONS |
EVHTTP_REQ_PATCH);
evhttp_set_gencb(ev_http_, &DispatchEvRequestFn, this);

return true;
Expand Down

0 comments on commit 6cbc4a9

Please sign in to comment.