mirror of
				https://github.com/gin-gonic/gin.git
				synced 2025-10-31 07:02:13 +08:00 
			
		
		
		
	Fixes context.String()
This commit is contained in:
		
							parent
							
								
									cde876395f
								
							
						
					
					
						commit
						f387bdda9e
					
				
							
								
								
									
										2
									
								
								gin.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								gin.go
									
									
									
									
									
								
							| @ -472,10 +472,10 @@ func (c *Context) HTML(code int, name string, data interface{}) { | ||||
| 
 | ||||
| // Writes the given string into the response body and sets the Content-Type to "text/plain". | ||||
| func (c *Context) String(code int, msg string) { | ||||
| 	c.Writer.Header().Set("Content-Type", MIMEPlain) | ||||
| 	if code >= 0 { | ||||
| 		c.Writer.WriteHeader(code) | ||||
| 	} | ||||
| 	c.Writer.Header().Set("Content-Type", MIMEPlain) | ||||
| 	c.Writer.Write([]byte(msg)) | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user