| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,10 +92,4 @@ class Request { | |||
| 92 | 92 | ||
| 93 | 93 | typedef std::shared_ptr<Request> request_t; | |
| 94 | 94 | ||
| 95 | - std::string getPathname(request_t req); | ||
| 96 | - | ||
| 97 | - std::optional<Url> parseUrl(request_t req); | ||
| 98 | - | ||
| 99 | - Url fastparse(const std::string &str); | ||
| 100 | - | ||
| 101 | 95 | } // namespace expresscpp | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -129,36 +129,4 @@ const std::string &Request::GetQueryString() const { | |||
| 129 | 129 | return query_string_; | |
| 130 | 130 | } | |
| 131 | 131 | ||
| 132 | - std::string getPathname(request_t req) { | ||
| 133 | - const auto url = parseUrl(req); | ||
| 134 | - if (url.has_value()) { | ||
| 135 | - return url.value().pathname; | ||
| 136 | - } | ||
| 137 | - | ||
| 138 | - return ""; | ||
| 139 | - } | ||
| 140 | - | ||
| 141 | - std::optional<Url> parseUrl(request_t req) { | ||
| 142 | - if (req->getUrl().size() == 0) { | ||
| 143 | - return std::nullopt; | ||
| 144 | - } | ||
| 145 | - | ||
| 146 | - return fastparse(req->getUrl()); | ||
| 147 | - } | ||
| 148 | - | ||
| 149 | - Url fastparse(const std::string &str) { | ||
| 150 | - Url url; | ||
| 151 | - auto pathname = str; | ||
| 152 | - auto query = ""s; | ||
| 153 | - auto search = ""s; | ||
| 154 | - url.path = str; | ||
| 155 | - url.href = str; | ||
| 156 | - url.pathname = pathname; | ||
| 157 | - if (search != "") { | ||
| 158 | - url.query = query; | ||
| 159 | - url.search = search; | ||
| 160 | - } | ||
| 161 | - return url; | ||
| 162 | - } | ||
| 163 | - | ||
| 164 | 132 | } // namespace expresscpp | |
| Back | FazBrowse Home | New Git URL |
0 commit comments