mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Use context instead of response in static_headers helpers
This commit is contained in:
		
							parent
							
								
									e69bd400b7
								
							
						
					
					
						commit
						bae9864833
					
				
					 3 changed files with 9 additions and 9 deletions
				
			
		|  | @ -141,11 +141,11 @@ describe Kemal::StaticFileHandler do | |||
|   end | ||||
| 
 | ||||
|   it "should handle setting custom headers" do | ||||
|     headers = Proc(HTTP::Server::Response, String, File::Info, Void).new do |response, path, stat| | ||||
|     headers = Proc(HTTP::Server::Context, String, File::Info, Void).new do |env, path, stat| | ||||
|       if path =~ /\.html$/ | ||||
|         response.headers.add("Access-Control-Allow-Origin", "*") | ||||
|         env.response.headers.add("Access-Control-Allow-Origin", "*") | ||||
|       end | ||||
|       response.headers.add("Content-Size", stat.size.to_s) | ||||
|       env.response.headers.add("Content-Size", stat.size.to_s) | ||||
|     end | ||||
| 
 | ||||
|     static_headers(&headers) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue