Bläddra i källkod

removed cmt and prints

Josh Yan 9 månader sedan
förälder
incheckning
a80d79536a
2 ändrade filer med 0 tillägg och 23 borttagningar
  1. 0 2
      cmd/copy_windows.go
  2. 0 21
      server/routes.go

+ 0 - 2
cmd/copy_windows.go

@@ -4,7 +4,6 @@
 package cmd
 package cmd
 
 
 import (
 import (
-	"fmt"
 	"os"
 	"os"
 	"path/filepath"
 	"path/filepath"
 	"syscall"
 	"syscall"
@@ -42,7 +41,6 @@ func localCopy(src, target string) error {
 }
 }
 
 
 func copyFileEx(src, dst string) error {
 func copyFileEx(src, dst string) error {
-	fmt.Println("HELELELLEEOEOEOEO")
 	kernel32 := syscall.NewLazyDLL("kernel32.dll")
 	kernel32 := syscall.NewLazyDLL("kernel32.dll")
 	copyFileEx := kernel32.NewProc("CopyFileExW")
 	copyFileEx := kernel32.NewProc("CopyFileExW")
 
 

+ 0 - 21
server/routes.go

@@ -943,10 +943,8 @@ func (s *Server) CreateBlobHandler(c *gin.Context) {
 		c.Status(http.StatusOK)
 		c.Status(http.StatusOK)
 		return
 		return
 	}
 	}
-	fmt.Println("hello")
 	fmt.Println(s.IsLocal(c))
 	fmt.Println(s.IsLocal(c))
 	if c.GetHeader("X-Redirect-Create") == "1" && s.IsLocal(c) {
 	if c.GetHeader("X-Redirect-Create") == "1" && s.IsLocal(c) {
-		fmt.Println("entered redirect")
 		c.Header("LocalLocation", path)
 		c.Header("LocalLocation", path)
 		c.Status(http.StatusTemporaryRedirect)
 		c.Status(http.StatusTemporaryRedirect)
 		return
 		return
@@ -967,8 +965,6 @@ func (s *Server) CreateBlobHandler(c *gin.Context) {
 }
 }
 
 
 func (s *Server) IsLocal(c *gin.Context) bool {
 func (s *Server) IsLocal(c *gin.Context) bool {
-	fmt.Println("entered islocal")
-	fmt.Println(c.GetHeader("Authorization"), " is authorization")
 	if authz := c.GetHeader("Authorization"); authz != "" {
 	if authz := c.GetHeader("Authorization"); authz != "" {
 		parts := strings.Split(authz, ":")
 		parts := strings.Split(authz, ":")
 		if len(parts) != 3 {
 		if len(parts) != 3 {
@@ -995,23 +991,6 @@ func (s *Server) IsLocal(c *gin.Context) bool {
 			return false
 			return false
 		}
 		}
 
 
-		/* timestamp, err := strconv.ParseInt(partialRequestDataParts[2], 10, 0)
-		if err != nil {
-			return false
-		}
-
-		t := time.Unix(timestamp, 0)
-		if time.Since(t) > 5*time.Minute || time.Until(t) > 5*time.Minute {
-			// token is invalid if timestamp +/- 5 minutes from current time
-			return false
-		} */
-
-		/* nonce := partialRequestDataParts[3]
-		if nonceCache.has(nonce) {
-			return false
-		}
-		nonceCache.add(nonce, 5*time.Minute) */
-
 		signature, err := base64.StdEncoding.DecodeString(parts[2])
 		signature, err := base64.StdEncoding.DecodeString(parts[2])
 		if err != nil {
 		if err != nil {
 			fmt.Println("failed at decodeString stdEncoding")
 			fmt.Println("failed at decodeString stdEncoding")