From 8142d554bd3de7419a455e27904d0d369f1b0bee Mon Sep 17 00:00:00 2001
From: RandomChars <random@chars.jp>
Date: Fri, 20 Aug 2021 14:21:24 +0900
Subject: [PATCH] correct operator usage

---
 api.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/api.go b/api.go
index 77bcd1a..f199bae 100644
--- a/api.go
+++ b/api.go
@@ -335,7 +335,7 @@ func registerAPI() {
 	router.GET(api.ImageFile, func(context *gin.Context) {
 		flake := context.Param("flake")
 		image, data := instance.ImageData(instance.ImageSnowflakeHash(flake), false)
-		if image.Snowflake == flake {
+		if image.Snowflake != flake {
 			context.JSON(http.StatusNotFound, api.Error{Error: "not found"})
 			return
 		}
@@ -345,7 +345,7 @@ func registerAPI() {
 	router.GET(api.ImagePreview, func(context *gin.Context) {
 		flake := context.Param("flake")
 		image, data := instance.ImageData(instance.ImageSnowflakeHash(flake), true)
-		if image.Snowflake == flake {
+		if image.Snowflake != flake {
 			context.JSON(http.StatusNotFound, api.Error{Error: "not found"})
 			return
 		}
-- 
GitLab