<!DOCTYPE html>
-<html>
+<html lang="en-US">
<head>
<meta charset="utf-8" />
d="M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z" />
</svg>
</label>
- <input type="file" id="file" name="file" multiple>
+ <input type="file" id="file" title="Upload files" name="file" multiple>
</div>
<div class="control new-folder hidden" title="New folder">
<svg width="16" height="16" viewBox="0 0 16 16">
d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg>
</div>
- <input id="search" name="q" type="text" maxlength="128" autocomplete="off" tabindex="1">
+ <input id="search" title="Searching for folders or files" name="q" type="text" maxlength="128" autocomplete="off" tabindex="1">
<input type="submit" hidden />
</form>
<div class="toolbox-right">
</div>
<div class="editor-page hidden">
<div class="not-editable hidden"></div>
- <textarea class="editor hidden" cols="10"></textarea>
+ <textarea id="editor" class="editor hidden" title="Edit file" cols="10"></textarea>
</div>
</div>
<script>
}
const encodedName = encodedStr(name);
if (i === 0) {
- $breadcrumb.insertAdjacentHTML("beforeend", `<a href="${path}"><svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5z"/></svg></a>`);
+ $breadcrumb.insertAdjacentHTML("beforeend", `<a href="${path}" title="Root"><svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5z"/></svg></a>`);
} else if (i === len - 1) {
$breadcrumb.insertAdjacentHTML("beforeend", `<b>${encodedName}</b>`);
} else {
use chrono::{LocalResult, TimeZone, Utc};
use futures::TryStreamExt;
use headers::{
- AcceptRanges, AccessControlAllowCredentials, AccessControlAllowOrigin, ContentLength,
- ContentType, ETag, HeaderMap, HeaderMapExt, IfModifiedSince, IfNoneMatch, IfRange,
- LastModified, Range,
+ AcceptRanges, AccessControlAllowCredentials, AccessControlAllowOrigin, CacheControl,
+ ContentLength, ContentType, ETag, HeaderMap, HeaderMapExt, IfModifiedSince, IfNoneMatch,
+ IfRange, LastModified, Range,
};
use hyper::header::{
HeaderValue, AUTHORIZATION, CONTENT_DISPOSITION, CONTENT_LENGTH, CONTENT_RANGE, CONTENT_TYPE,
*res.body_mut() = Body::from(INDEX_JS);
res.headers_mut().insert(
"content-type",
- HeaderValue::from_static("application/javascript"),
+ HeaderValue::from_static("application/javascript; charset=UTF-8"),
);
}
"index.css" => {
*res.body_mut() = Body::from(INDEX_CSS);
- res.headers_mut()
- .insert("content-type", HeaderValue::from_static("text/css"));
+ res.headers_mut().insert(
+ "content-type",
+ HeaderValue::from_static("text/css; charset=UTF-8"),
+ );
}
"favicon.ico" => {
*res.body_mut() = Body::from(FAVICON_ICO);
}
res.headers_mut().insert(
"cache-control",
- HeaderValue::from_static("max-age=2592000, public"),
+ HeaderValue::from_static("public, max-age=31536000, immutable"),
+ );
+ res.headers_mut().insert(
+ "x-content-type-options",
+ HeaderValue::from_static("nosniff"),
);
Ok(true)
} else {
};
res.headers_mut()
.typed_insert(ContentLength(output.as_bytes().len() as u64));
+ res.headers_mut()
+ .typed_insert(CacheControl::new().with_no_cache());
+ res.headers_mut().insert(
+ "x-content-type-options",
+ HeaderValue::from_static("nosniff"),
+ );
if head_only {
return Ok(());
}
assert_eq!(resp.status(), 200);
assert_eq!(
resp.headers().get("content-type").unwrap(),
- "application/javascript"
+ "application/javascript; charset=UTF-8"
);
Ok(())
}
);
let resp = reqwest::blocking::get(url)?;
assert_eq!(resp.status(), 200);
- assert_eq!(resp.headers().get("content-type").unwrap(), "text/css");
+ assert_eq!(
+ resp.headers().get("content-type").unwrap(),
+ "text/css; charset=UTF-8"
+ );
Ok(())
}
assert_eq!(resp.status(), 200);
assert_eq!(
resp.headers().get("content-type").unwrap(),
- "application/javascript"
+ "application/javascript; charset=UTF-8"
);
Ok(())
}