File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -144,14 +144,18 @@ impl FileSystem {
144144 for ( i, component) in path. components ( ) . enumerate ( ) {
145145 if let Component :: Normal ( c) = component {
146146 if i == 0 && c. eq_ignore_ascii_case ( "sqlpage" ) {
147- anyhow :: bail! ( ErrorWithStatus {
147+ return Err ( ErrorWithStatus {
148148 status : actix_web:: http:: StatusCode :: FORBIDDEN ,
149+ } )
150+ . with_context ( || {
151+ "The /sqlpage/ path prefix is reserved for internal use. It is not public."
149152 } ) ;
150153 }
151154 if c. as_encoded_bytes ( ) . starts_with ( b"." ) {
152- anyhow :: bail! ( ErrorWithStatus {
155+ return Err ( ErrorWithStatus {
153156 status : actix_web:: http:: StatusCode :: FORBIDDEN ,
154- } ) ;
157+ } )
158+ . with_context ( || "Directory traversal is not allowed" ) ;
155159 }
156160 } else {
157161 anyhow:: bail!(
Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ pub async fn main_handler(
338338 Ok ( action) => action,
339339 Err ( e) => {
340340 let e = e. context ( format ! (
341- "The server cannot provide what you were asking for . \n \
341+ "The server was unable to fulfill your request . \n \
342342 The following page is not accessible: {path_and_query:?}"
343343 ) ) ;
344344 return Err ( anyhow_err_to_actix ( e, app_state) ) ;
You can’t perform that action at this time.
0 commit comments