-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Added - [Files] Files can now be selected multiple files and downloaded, deleted, moved, etc. - [Apps] Support to modify the application opening address.([#204](#204)) ### Changed - [Apps] Hide the display of non-essential environment variables in the application. - [System] Network, disk, cpu, memory, etc. information is modified to be pushed via socket. - [System] Optimize opening speed.([#214](#214)) ### Fixed - [System] Fixed the problem that sync data cannot submit the device ID ([#68](#68)) - [Files] Fixed the code editor center alignment display problem.([#210](#210)) - [Files] Fixed the problem of wrong name when downloading files.([#240](#240)) - [System] Fixed the network display as a negative number problem.([#224](#224))
- Loading branch information
Showing
60 changed files
with
3,407 additions
and
1,842 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
/* | ||
* @Author: LinkLeong [email protected] | ||
* @Date: 2021-10-08 10:29:08 | ||
* @LastEditors: LinkLeong | ||
* @LastEditTime: 2022-05-25 19:17:45 | ||
* @FilePath: /CasaOS/middleware/gin.go | ||
* @Description: | ||
* @Website: https://www.casaos.io | ||
* Copyright (c) 2022 by icewhale, All Rights Reserved. | ||
*/ | ||
package middleware | ||
|
||
import ( | ||
|
@@ -10,20 +20,16 @@ import ( | |
func Cors() gin.HandlerFunc { | ||
return func(c *gin.Context) { | ||
method := c.Request.Method | ||
//origin := c.Request.Header.Get("Origin") //请求头部 | ||
//if origin != "" { | ||
//接收客户端发送的origin (重要!) | ||
c.Writer.Header().Set("Access-Control-Allow-Origin", "*") | ||
|
||
c.Header("Access-Control-Allow-Origin", "*") | ||
//服务器支持的所有跨域请求的方法 | ||
c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE,UPDATE") | ||
//允许跨域设置可以返回其他子段,可以自定义字段 | ||
c.Header("Access-Control-Allow-Headers", "Authorization, Content-Length, X-CSRF-Token, Token,session,Language") | ||
// 允许浏览器(客户端)可以解析的头部 (重要) | ||
c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers") | ||
//c.Writer.Header().Set("Access-Control-Allow-Headers", "Accept, Authorization, Content-Type, Content-Length, X-CSRF-Token, Token, session, Origin, Host, Connection, Accept-Encoding, Accept-Language, X-Requested-With") | ||
//设置缓存时间 | ||
c.Header("Access-Control-Max-Age", "172800") | ||
//允许客户端传递校验信息比如 cookie (重要) | ||
c.Header("Access-Control-Allow-Credentials", "true") | ||
c.Set("content-type", "application/json") | ||
//} | ||
|
Oops, something went wrong.