Explorar el Código

update oss-store ObjectGetController

reghao hace 1 año
padre
commit
0dddc46921

+ 6 - 0
oss-store/src/main/java/cn/reghao/oss/store/controller/ObjectGetController.java

@@ -80,6 +80,12 @@ public class ObjectGetController {
         }
 
         String secretKey = cache.getIfPresent(token);
+        if (secretKey == null) {
+            String payload = "secretKey not found";
+            getObjectService.writeResponse(HttpServletResponse.SC_FORBIDDEN, payload);
+            return;
+        }
+
         String queryString = String.format("token=%s&t=%s&nonce=%s", token, timestamp, nonce);
         String host = ServletUtil.getHeader("host");
         String url = String.format("//%s/%s", host, objectName);