mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Treat body as IO in param_parser (#252)
This commit is contained in:
		
							parent
							
								
									012ac8f6b7
								
							
						
					
					
						commit
						bc764b7af7
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -64,7 +64,7 @@ module Kemal | |||
|     def parse_json | ||||
|       return unless @request.body && @request.headers["Content-Type"]?.try(&.starts_with?(APPLICATION_JSON)) | ||||
| 
 | ||||
|       body = @request.body.as(String) | ||||
|       body = @request.body.to_s | ||||
|       case json = JSON.parse(body).raw | ||||
|       when Hash | ||||
|         json.each do |key, value| | ||||
|  | @ -76,7 +76,7 @@ module Kemal | |||
|     end | ||||
| 
 | ||||
|     def parse_part(part) | ||||
|       HTTP::Params.parse(part || "") | ||||
|       HTTP::Params.parse(part.to_s || "") | ||||
|     end | ||||
|   end | ||||
| end | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue