Seastar
High performance C++ framework for concurrent servers
|
Check if the url match a parameter and fill the parameters object
Note that a non empty url will always return true with the parameters object filled
Assume that the rule is /file/{path}/ and the param_matcher identify the /{path}
For all non empty values, match will return true. If the entire url is /file/etc/hosts, and the part that is passed to param_matcher is /etc/hosts, if entire_path is true, the match will be '/etc/hosts' If entire_path is false, the match will be '/etc'
#include <seastar/http/matcher.hh>
Public Member Functions | |
param_matcher (const sstring &name, bool entire_path=false) | |
virtual size_t | match (const sstring &url, size_t ind, parameters ¶m) override |
|
inlineexplicit |
Constructor
name | the name of the parameter, will be used as the key in the parameters object |
entire_path | when set to true, the matched parameters will include all the remaining url until the end of it. when set to false the match will terminate at the next slash |
|
overridevirtual |
check if the given url matches the rule
url | the url to check |
ind | the position to start from |
param | fill the parameters hash |
Implements seastar::httpd::matcher.