Skip to content

Commit cf6d78e

Browse files
authored
release: nightly 0.1.2 (#3)
1 parent e7b75a6 commit cf6d78e

2 files changed

Lines changed: 6 additions & 19 deletions

File tree

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.1.2]
9+
10+
### Changed
11+
12+
- Use of `NamedFile` to serve a file.
13+
814
## [0.1.1]
915

1016
### Fixed

src/services.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -192,25 +192,6 @@ async fn serve(
192192

193193
if path.is_file() {
194194
let file = path.clone();
195-
let extension = file.extension().unwrap_or_default();
196-
if extension == "yaml" || extension == "yml" {
197-
let content = web::block(move || fs::read_to_string(path))
198-
.await
199-
.map_err(|err| {
200-
err
201-
.map_err_context(|| {
202-
format!("Failed to read file {}", file.display())
203-
})
204-
.set_status(StatusCode::INTERNAL_SERVER_ERROR)
205-
})?;
206-
207-
return Ok(
208-
web::HttpResponse::Ok()
209-
.content_type("text/plain")
210-
.content_length(content.len() as u64)
211-
.body(content),
212-
);
213-
}
214195
let err_file = file.clone();
215196
let res =
216197
web::block(move || NamedFile::open(file))

0 commit comments

Comments
 (0)