httpd: Add /raw route to get file at canonical head
Instead of requiring to specify a commit to obtain a file through the
/raw route, this commit allows to prefix /head to get the file at the
current canonical head commit.
1 file changed
+37
-11
3ae7e305
→
dff6df10
modified radicle-httpd/src/raw.rs
@@ -7,6 +7,7 @@ use axum::response::IntoResponse;
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -94,8 +95,9 @@ static MIMES: &[(&str, &str)] = &[
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -106,7 +108,7 @@ pub fn router(profile: Arc<Profile>) -> Router {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -118,10 +120,36 @@ async fn file_by_path_handler(
|
|
|
|
|
|
| - | |
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -171,8 +199,8 @@ async fn file_by_oid_handler(
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -180,20 +208,18 @@ mod routes {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
|
|
|
|
| - | |
|
|
| - | |
| + | |
|
|
|
|
|