Fix rewriting original instance URLs
https://vt.social/@lina/111460117484406174
Regression caused by e231afb49c
This commit is contained in:
parent
402e74dd6e
commit
42ce457348
|
@ -107,8 +107,8 @@ bool starts_with(const CurlUrl& url, const CurlUrl& base) {
|
||||||
CurlStr url_path = url.get(CURLUPART_PATH);
|
CurlStr url_path = url.get(CURLUPART_PATH);
|
||||||
CurlStr base_path = base.get(CURLUPART_PATH);
|
CurlStr base_path = base.get(CURLUPART_PATH);
|
||||||
size_t base_path_len = strlen(base_path.get());
|
size_t base_path_len = strlen(base_path.get());
|
||||||
return memcpy(url_path.get(), base_path.get(), base_path_len) == 0
|
return memcmp(url_path.get(), base_path.get(), base_path_len) == 0
|
||||||
&& (url_path.get()[base_path_len] == '/' || url_path.get()[base_path_len] == '\0');
|
&& (base_path.get()[base_path_len - 1] == '/' || url_path.get()[base_path_len] == '/' || url_path.get()[base_path_len] == '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string get_origin(const httplib::Request& req) {
|
std::string get_origin(const httplib::Request& req) {
|
||||||
|
|
Loading…
Reference in New Issue