mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Do not early return from HTTP::Server::Response::Output.close. Revert what Ameba broke
This commit is contained in:
		
							parent
							
								
									f3d02e60af
								
							
						
					
					
						commit
						e3544a86bf
					
				
					 2 changed files with 21 additions and 12 deletions
				
			
		
							
								
								
									
										31
									
								
								.ameba.yml
									
										
									
									
									
								
							
							
						
						
									
										31
									
								
								.ameba.yml
									
										
									
									
									
								
							|  | @ -1,18 +1,8 @@ | ||||||
| # This configuration file was generated by `ameba --gen-config` | # This configuration file was generated by `ameba --gen-config` | ||||||
| # on 2019-06-13 12:39:59 UTC using Ameba version 0.10.0. | # on 2019-06-14 15:05:57 UTC using Ameba version 0.10.0. | ||||||
| # The point is for the user to remove these configuration records | # The point is for the user to remove these configuration records | ||||||
| # one by one as the reported problems are removed from the code base. | # one by one as the reported problems are removed from the code base. | ||||||
| 
 | 
 | ||||||
| # Problems found: 1 |  | ||||||
| # Run `ameba --only Lint/ShadowingOuterLocalVar` for details |  | ||||||
| Lint/ShadowingOuterLocalVar: |  | ||||||
|   Description: Disallows the usage of the same name as outer local variables for block |  | ||||||
|     or proc arguments. |  | ||||||
|   Enabled: true |  | ||||||
|   Severity: Warning |  | ||||||
|   Excluded: |  | ||||||
|   - spec/run_spec.cr |  | ||||||
| 
 |  | ||||||
| # Problems found: 7 | # Problems found: 7 | ||||||
| # Run `ameba --only Lint/UselessAssign` for details | # Run `ameba --only Lint/UselessAssign` for details | ||||||
| Lint/UselessAssign: | Lint/UselessAssign: | ||||||
|  | @ -22,6 +12,25 @@ Lint/UselessAssign: | ||||||
|   Excluded: |   Excluded: | ||||||
|   - spec/view_spec.cr |   - spec/view_spec.cr | ||||||
| 
 | 
 | ||||||
|  | # Problems found: 1 | ||||||
|  | # Run `ameba --only Lint/ShadowingOuterLocalVar` for details | ||||||
|  | Lint/ShadowingOuterLocalVar: | ||||||
|  |   Description: Disallows the usage of the same name as outer local variables for block | ||||||
|  |     or proc arguments. | ||||||
|  |   Enabled: true | ||||||
|  |   Severity: Warning | ||||||
|  |   Excluded: | ||||||
|  |   - spec/run_spec.cr | ||||||
|  | 
 | ||||||
|  | # Problems found: 1 | ||||||
|  | # Run `ameba --only Style/NegatedConditionsInUnless` for details | ||||||
|  | Style/NegatedConditionsInUnless: | ||||||
|  |   Description: Disallows negated conditions in unless | ||||||
|  |   Enabled: true | ||||||
|  |   Severity: Convention | ||||||
|  |   Excluded: | ||||||
|  |   - src/kemal/ext/response.cr | ||||||
|  | 
 | ||||||
| # Problems found: 1 | # Problems found: 1 | ||||||
| # Run `ameba --only Metrics/CyclomaticComplexity` for details | # Run `ameba --only Metrics/CyclomaticComplexity` for details | ||||||
| Metrics/CyclomaticComplexity: | Metrics/CyclomaticComplexity: | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| class HTTP::Server::Response | class HTTP::Server::Response | ||||||
|   class Output |   class Output | ||||||
|     def close |     def close | ||||||
|       if !response.wrote_headers? && response.headers.has_key?("Content-Range") |       unless response.wrote_headers? && !response.headers.has_key?("Content-Range") | ||||||
|         response.content_length = @out_count |         response.content_length = @out_count | ||||||
|       end |       end | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue