mirror of
				https://github.com/songquanpeng/one-api.git
				synced 2025-11-04 15:53:42 +08:00 
			
		
		
		
	fix: allow all origins (close #20)
This commit is contained in:
		@@ -8,5 +8,8 @@ import (
 | 
			
		||||
func CORS() gin.HandlerFunc {
 | 
			
		||||
	config := cors.DefaultConfig()
 | 
			
		||||
	config.AllowAllOrigins = true
 | 
			
		||||
	config.AllowCredentials = true
 | 
			
		||||
	config.AllowMethods = []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}
 | 
			
		||||
	config.AllowHeaders = []string{"Origin", "Content-Length", "Content-Type", "Authorization", "Accept", "Connection"}
 | 
			
		||||
	return cors.New(config)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user