Skip to content

Commit f93477b

Browse files
Warchamp7RytoEX
authored andcommitted
Fix local filepath on POSIX
1 parent 8725f07 commit f93477b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

browser-scheme.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ CefRefPtr<CefResourceHandler> BrowserSchemeHandlerFactory::Create(CefRefPtr<CefB
4242
if (fileExtension.compare("woff2") == 0)
4343
fileExtension = "woff";
4444

45-
std::string filePath = path.substr(path.find_first_not_of("/"));
46-
std::string checkString = filePath.substr(0, filePath.find_first_of("/"));
45+
std::string filePath = path.substr(1);
46+
47+
std::string checkString = path.substr(path.find_first_not_of("/"));
48+
checkString = checkString.substr(0, checkString.find_first_of("/"));
4749

4850
// An IP address should never be a valid path for CreateForFile normally, but in some cases an OS
4951
// can resolve one as such. As an extra safeguard, we prevent any IP addresses in the path.

0 commit comments

Comments
 (0)