mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Embed 404 image as SVG
This commit is contained in:
		
							parent
							
								
									621342170a
								
							
						
					
					
						commit
						d0b4c0d609
					
				
					 3 changed files with 2 additions and 12 deletions
				
			
		
							
								
								
									
										
											BIN
										
									
								
								images/404.png
									
										
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								images/404.png
									
										
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 20 KiB | 
							
								
								
									
										12
									
								
								src/kemal.cr
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								src/kemal.cr
									
										
									
									
									
								
							|  | @ -31,7 +31,7 @@ module Kemal | ||||||
|     config.setup |     config.setup | ||||||
|     config.port = port if port |     config.port = port if port | ||||||
| 
 | 
 | ||||||
|     # Test environment doesn't need to have signal trap, built-in images, and logging. |     # Test environment doesn't need to have signal trap and logging. | ||||||
|     if config.env != "test" |     if config.env != "test" | ||||||
|       setup_404 |       setup_404 | ||||||
|       setup_trap_signal |       setup_trap_signal | ||||||
|  | @ -79,16 +79,6 @@ module Kemal | ||||||
| 
 | 
 | ||||||
|   private def self.setup_404 |   private def self.setup_404 | ||||||
|     unless Kemal.config.error_handlers.has_key?(404) |     unless Kemal.config.error_handlers.has_key?(404) | ||||||
|       get "/__kemal__/404.png" do |env| |  | ||||||
|         file_path = File.expand_path("lib/kemal/images/404.png", Dir.current) |  | ||||||
| 
 |  | ||||||
|         if File.exists? file_path |  | ||||||
|           send_file env, file_path |  | ||||||
|         else |  | ||||||
|           halt env, 404 |  | ||||||
|         end |  | ||||||
|       end |  | ||||||
| 
 |  | ||||||
|       error 404 do |       error 404 do | ||||||
|         render_404 |         render_404 | ||||||
|       end |       end | ||||||
|  |  | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue