| 480 | } |
| 481 | |
| 482 | Result HttpAsyncFileServer::Internal::extractSafeFilePath(StringSpan requestTarget, StringSpan& filePath) |
| 483 | { |
| 484 | HttpRequestTargetView target; |
| 485 | SC_TRY(target.parse(requestTarget)); |
| 486 | SC_TRY_MSG(HttpStringIterator::startsWith(target.path, "/"), "HttpAsyncFileServer request target must be path"); |
| 487 | |
| 488 | filePath = HttpStringIterator::sliceStart(target.path, 1); |
| 489 | if (filePath.isEmpty()) |
| 490 | { |
| 491 | filePath = "index.html"; |
| 492 | return Result(true); |
| 493 | } |
| 494 | |
| 495 | return validateSafeRelativePath(filePath); |
| 496 | } |
| 497 | |
| 498 | Result HttpAsyncFileServer::Internal::normalizeOptionFilePath(StringSpan filePath, StringSpan& normalizedPath) |
| 499 | { |
nothing calls this directly
no test coverage detected