mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
		@@ -850,7 +850,7 @@ MACARON = file
 | 
				
			|||||||
ROUTER_LOG_LEVEL = Info
 | 
					ROUTER_LOG_LEVEL = Info
 | 
				
			||||||
ROUTER = console
 | 
					ROUTER = console
 | 
				
			||||||
ENABLE_ACCESS_LOG = false
 | 
					ENABLE_ACCESS_LOG = false
 | 
				
			||||||
ACCESS_LOG_TEMPLATE = {{.Ctx.RemoteAddr}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}\" \"{{.Ctx.Req.UserAgent}}"
 | 
					ACCESS_LOG_TEMPLATE = {{.Ctx.RemoteAddr}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.URL.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}\" \"{{.Ctx.Req.UserAgent}}"
 | 
				
			||||||
ACCESS = file
 | 
					ACCESS = file
 | 
				
			||||||
; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
 | 
					; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
 | 
				
			||||||
LEVEL = Info
 | 
					LEVEL = Info
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -121,11 +121,11 @@ func storageHandler(storageSetting setting.Storage, prefix string, objStore stor
 | 
				
			|||||||
				return
 | 
									return
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if !strings.HasPrefix(req.RequestURI, "/"+prefix) {
 | 
								if !strings.HasPrefix(req.URL.RequestURI(), "/"+prefix) {
 | 
				
			||||||
				return
 | 
									return
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			rPath := strings.TrimPrefix(req.RequestURI, "/"+prefix)
 | 
								rPath := strings.TrimPrefix(req.URL.RequestURI(), "/"+prefix)
 | 
				
			||||||
			u, err := objStore.URL(rPath, path.Base(rPath))
 | 
								u, err := objStore.URL(rPath, path.Base(rPath))
 | 
				
			||||||
			if err != nil {
 | 
								if err != nil {
 | 
				
			||||||
				if os.IsNotExist(err) || errors.Is(err, os.ErrNotExist) {
 | 
									if os.IsNotExist(err) || errors.Is(err, os.ErrNotExist) {
 | 
				
			||||||
@@ -152,11 +152,11 @@ func storageHandler(storageSetting setting.Storage, prefix string, objStore stor
 | 
				
			|||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if !strings.HasPrefix(req.RequestURI, "/"+prefix) {
 | 
							if !strings.HasPrefix(req.URL.RequestURI(), "/"+prefix) {
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		rPath := strings.TrimPrefix(req.RequestURI, "/"+prefix)
 | 
							rPath := strings.TrimPrefix(req.URL.RequestURI(), "/"+prefix)
 | 
				
			||||||
		rPath = strings.TrimPrefix(rPath, "/")
 | 
							rPath = strings.TrimPrefix(rPath, "/")
 | 
				
			||||||
		//If we have matched and access to release or issue
 | 
							//If we have matched and access to release or issue
 | 
				
			||||||
		fr, err := objStore.Open(rPath)
 | 
							fr, err := objStore.Open(rPath)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user