Add jpeg with exif format
This commit is contained in:
		
							
								
								
									
										10
									
								
								rsaserver.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								rsaserver.go
									
									
									
									
									
								
							@@ -18,6 +18,8 @@ import (
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var jpegExif = []byte{0xff, 0xd8, 0xff, 0xe1}
 | 
			
		||||
 | 
			
		||||
func main() {
 | 
			
		||||
	host := "0.0.0.0"
 | 
			
		||||
	port := 8080
 | 
			
		||||
@@ -191,12 +193,18 @@ func handleDecrypted(decryptedDataB []byte, uidB []byte) {
 | 
			
		||||
            panic(err)
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fmt.Println(data[:4])
 | 
			
		||||
    
 | 
			
		||||
    var fileTDef string
 | 
			
		||||
    if fileType != nil {
 | 
			
		||||
        fileTDef = fileType.Extension
 | 
			
		||||
    } else {
 | 
			
		||||
        fileTDef = "unknown"
 | 
			
		||||
	    if(string(data[:4]) == string(jpegExif)){
 | 
			
		||||
		    fileTDef = "jpeg"
 | 
			
		||||
	    }else{
 | 
			
		||||
		    fileTDef = "unknown"
 | 
			
		||||
	    }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    uid := strings.TrimSpace(string(uidB))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user