Skip to content

Commit 3519c81

Browse files
committed
frontend: Fix local filepath on posix
1 parent 8725f07 commit 3519c81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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, filePath.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)