removed cmt and prints

This commit is contained in:
Josh Yan 2024-07-08 10:37:35 -07:00
parent 4c1e188200
commit a80d79536a
2 changed files with 0 additions and 23 deletions

View File

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

View File

@ -943,10 +943,8 @@ func (s *Server) CreateBlobHandler(c *gin.Context) {
c.Status(http.StatusOK)
return
}
fmt.Println("hello")
fmt.Println(s.IsLocal(c))
if c.GetHeader("X-Redirect-Create") == "1" && s.IsLocal(c) {
fmt.Println("entered redirect")
c.Header("LocalLocation", path)
c.Status(http.StatusTemporaryRedirect)
return
@ -967,8 +965,6 @@ func (s *Server) CreateBlobHandler(c *gin.Context) {
}
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 != "" {
parts := strings.Split(authz, ":")
if len(parts) != 3 {
@ -995,23 +991,6 @@ func (s *Server) IsLocal(c *gin.Context) bool {
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])
if err != nil {
fmt.Println("failed at decodeString stdEncoding")