mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Prevent send_file returning filesize (#344)
Prevent send_file returning filesize
This commit is contained in:
		
							parent
							
								
									f1edf81d95
								
							
						
					
					
						commit
						48128696c6
					
				
					 2 changed files with 3 additions and 2 deletions
				
			
		|  | @ -88,7 +88,7 @@ describe "Macros" do | |||
|       response = call_request_on_app(request) | ||||
|       response.status_code.should eq(200) | ||||
|       response.headers["Content-Type"].should eq("application/octet-stream") | ||||
|       response.headers["Content-Length"].should eq("20") | ||||
|       response.headers["Content-Length"].should eq("18") | ||||
|     end | ||||
| 
 | ||||
|     it "sends file with given path and given mime-type" do | ||||
|  | @ -100,7 +100,7 @@ describe "Macros" do | |||
|       response = call_request_on_app(request) | ||||
|       response.status_code.should eq(200) | ||||
|       response.headers["Content-Type"].should eq("image/jpeg") | ||||
|       response.headers["Content-Length"].should eq("20") | ||||
|       response.headers["Content-Length"].should eq("18") | ||||
|     end | ||||
| 
 | ||||
|     it "sends file with binary stream" do | ||||
|  |  | |||
|  | @ -116,6 +116,7 @@ def send_file(env, path : String, mime_type : String? = nil) | |||
|       IO.copy(file, env.response) | ||||
|     end | ||||
|   end | ||||
|   return | ||||
| end | ||||
| 
 | ||||
| private def multipart(file, env) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue