🐛Fix: Secret 已被弃用
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
package cn.hezhaohui.webhook.constant;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class Payload {
|
|
||||||
public final static String SECRET = "dn293830";
|
|
||||||
}
|
|
||||||
@@ -9,7 +9,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import static cn.hezhaohui.webhook.constant.Payload.SECRET;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/hook")
|
@RequestMapping("/hook")
|
||||||
@@ -23,10 +22,6 @@ public class HookController {
|
|||||||
public void handlePush(@RequestBody GiteaPushEvent event) {
|
public void handlePush(@RequestBody GiteaPushEvent event) {
|
||||||
log.info(event.toString());
|
log.info(event.toString());
|
||||||
|
|
||||||
if(!SECRET.equals(event.getSecret())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hookService.handlePush(event);
|
hookService.handlePush(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user