cpp-httplib icon indicating copy to clipboard operation
cpp-httplib copied to clipboard

Server Handlers update

Open lenrys29 opened this issue 1 year ago • 1 comments

Hi,

I'm currently using the library (v0.16.0) and I've discovered that after defining a handler for example for Get. We can't update it after. This is due to the usage for emplace_back putting in the vector list the new pair<pattern,handler> :

inline Server &Server::Get(const std::string &pattern, Handler handler) {
  get_handlers_.emplace_back(make_matcher(pattern), std::move(handler));
  return *this;
}

Does it makes sense to allow redefining the handler after first definition ?

Regards

lenrys29 avatar Jan 23 '25 10:01 lenrys29

There is no v0.16.0 available, yet...

yhirose avatar Jan 23 '25 18:01 yhirose