fixed getting list of posts not working behind nginx reverse proxy
This commit is contained in:
parent
5c556a0803
commit
6de27d602a
|
@ -192,7 +192,7 @@ fn handle_connection(mut stream: TcpStream) {
|
||||||
|
|
||||||
return a.cmp(&b);
|
return a.cmp(&b);
|
||||||
});
|
});
|
||||||
entries
|
let data = entries
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|x| {
|
.filter_map(|x| {
|
||||||
if let Some(n) = x.file_name().to_str() {
|
if let Some(n) = x.file_name().to_str() {
|
||||||
|
@ -206,7 +206,8 @@ fn handle_connection(mut stream: TcpStream) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.reduce(|a, b| format!("{}\n{}", b, a))
|
.reduce(|a, b| format!("{}\n{}", b, a))
|
||||||
.unwrap()
|
.unwrap();
|
||||||
|
format!("HTTP/1.1 200 OK\r\nContent-Type: text/text\r\nContent-Length: {}\r\n\r\n{}", data.len(), data)
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("\x1b[0;31mError when fetching list of posts: {e:?}\x1b[0m");
|
eprintln!("\x1b[0;31mError when fetching list of posts: {e:?}\x1b[0m");
|
||||||
|
|
Loading…
Reference in a new issue