mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
http server: allow serving files with special unicode path
This commit is contained in:
parent
cced56b2ad
commit
365328c4d3
1 changed files with 7 additions and 3 deletions
|
@ -720,9 +720,13 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin,
|
|||
}
|
||||
#else
|
||||
#if defined(LWS_HAVE__STAT32I64)
|
||||
if (_stat32i64(path, &st)) {
|
||||
lwsl_info("unable to stat %s\n", path);
|
||||
goto notfound;
|
||||
{
|
||||
WCHAR buf[MAX_PATH];
|
||||
MultiByteToWideChar(CP_UTF8, 0, path, -1, buf, LWS_ARRAY_SIZE(buf));
|
||||
if (_wstat32i64(buf, &st)) {
|
||||
lwsl_info("unable to stat %s\n", path);
|
||||
goto notfound;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (stat(path, &st)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue