mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 14:22:25 -05:00 
			
		
		
		
	[bugfix] Fix EmptyJSONObject/EmptyJSONArray (#2576)
* Fix EmptyJSONObject/EmptyJSONArray
These are meant to be the bytes representing an empty object and array in JSON: `{}` and `[]`. They are actually the strings `"{}"` and `"[]"`. This causes clients expecting an object or array to not be able to parse the response.
* Use json.RawMessage instead of []byte
	
	
This commit is contained in:
		
					parent
					
						
							
								e178a7b17e
							
						
					
				
			
			
				commit
				
					
						7e0a203173
					
				
			
		
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -51,8 +51,8 @@ var ( | ||||||
| 	ErrorRateLimited = mustJSON(map[string]string{ | 	ErrorRateLimited = mustJSON(map[string]string{ | ||||||
| 		"error": "rate limit reached", | 		"error": "rate limit reached", | ||||||
| 	}) | 	}) | ||||||
| 	EmptyJSONObject = mustJSON("{}") | 	EmptyJSONObject = json.RawMessage(`{}`) | ||||||
| 	EmptyJSONArray  = mustJSON("[]") | 	EmptyJSONArray  = json.RawMessage(`[]`) | ||||||
| 
 | 
 | ||||||
| 	// write buffer pool. | 	// write buffer pool. | ||||||
| 	bufPool sync.Pool | 	bufPool sync.Pool | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue