mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Remove Gzip hack since https://github.com/crystal-lang/crystal/issues/4060 is fixed
This commit is contained in:
		
							parent
							
								
									9c90fe5794
								
							
						
					
					
						commit
						a430b85ee7
					
				
					 1 changed files with 0 additions and 43 deletions
				
			
		
							
								
								
									
										43
									
								
								src/kemal.cr
									
										
									
									
									
								
							
							
						
						
									
										43
									
								
								src/kemal.cr
									
										
									
									
									
								
							|  | @ -6,49 +6,6 @@ require "./kemal/*" | ||||||
| require "./kemal/ext/*" | require "./kemal/ext/*" | ||||||
| require "./kemal/helpers/*" | require "./kemal/helpers/*" | ||||||
| 
 | 
 | ||||||
| # This is literally `hack` to fix [Crystal issue #4060](https://github.com/crystal-lang/crystal/issues/4060) |  | ||||||
| class Gzip::Header |  | ||||||
|   def to_io(io) |  | ||||||
|     # header |  | ||||||
|     io.write_byte ID1 |  | ||||||
|     io.write_byte ID2 |  | ||||||
| 
 |  | ||||||
|     # compression method |  | ||||||
|     io.write_byte DEFLATE |  | ||||||
| 
 |  | ||||||
|     # flg |  | ||||||
|     flg = Flg::None |  | ||||||
|     flg |= Flg::EXTRA if !@extra.empty? |  | ||||||
|     flg |= Flg::NAME if @name |  | ||||||
|     flg |= Flg::COMMENT if @comment |  | ||||||
|     io.write_byte flg.value |  | ||||||
| 
 |  | ||||||
|     # time |  | ||||||
|     io.write_bytes(modification_time.epoch.to_u32, IO::ByteFormat::LittleEndian) |  | ||||||
| 
 |  | ||||||
|     # xfl |  | ||||||
|     io.write_byte 0_u8 |  | ||||||
| 
 |  | ||||||
|     # os |  | ||||||
|     io.write_byte os |  | ||||||
| 
 |  | ||||||
|     if !@extra.empty? |  | ||||||
|       io.write_byte @extra.size.to_u8 |  | ||||||
|       io.write(@extra) |  | ||||||
|     end |  | ||||||
| 
 |  | ||||||
|     if name = @name |  | ||||||
|       io << name |  | ||||||
|       io.write_byte 0_u8 |  | ||||||
|     end |  | ||||||
| 
 |  | ||||||
|     if comment = @comment |  | ||||||
|       io << comment |  | ||||||
|       io.write_byte 0_u8 |  | ||||||
|     end |  | ||||||
|   end |  | ||||||
| end |  | ||||||
| 
 |  | ||||||
| module Kemal | module Kemal | ||||||
|   # Overload of self.run with the default startup logging |   # Overload of self.run with the default startup logging | ||||||
|   def self.run(port = nil) |   def self.run(port = nil) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue