This commit is contained in:
		
							parent
							
								
									02ee76a2ed
								
							
						
					
					
						commit
						ce3fa95b54
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -33,7 +33,6 @@ pub fn main() { | ||||||
|           ) |           ) | ||||||
|         ["echo"] -> echo_body(req) |         ["echo"] -> echo_body(req) | ||||||
|         ["chunk"] -> serve_chunk(req) |         ["chunk"] -> serve_chunk(req) | ||||||
|         ["file", ..rest] -> serve_file(req, rest) |  | ||||||
|         ["form"] -> handle_form(req) |         ["form"] -> handle_form(req) | ||||||
| 
 | 
 | ||||||
|         _ -> not_found |         _ -> not_found | ||||||
|  | @ -96,3 +95,9 @@ fn serve_chunk(_request: Request(Connection)) -> Response(ResponseData) { | ||||||
|   |> response.set_body(mist.Chunked(iter)) |   |> response.set_body(mist.Chunked(iter)) | ||||||
|   |> response.set_header("content-type", "text/plain") |   |> response.set_header("content-type", "text/plain") | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | fn handle_form(req: Request(Connection)) -> Response(ResponseData) { | ||||||
|  |   let _req = mist.read_body(req, 1024 * 1024 * 30) | ||||||
|  |   response.new(200) | ||||||
|  |   |> response.set_body(mist.Bytes(bytes_builder.new())) | ||||||
|  | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue