File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import (
26
26
)
27
27
28
28
func main () {
29
- channelSecret := "DummyChannelSecret" // Dummy value is fine to skip webhook signature verification
29
+ channelSecret := os . Getenv ( "LINE_CHANNEL_SECRET" )
30
30
bot , err := messaging_api .NewMessagingApiAPI (
31
31
os .Getenv ("LINE_CHANNEL_TOKEN" ),
32
32
)
@@ -38,9 +38,7 @@ func main() {
38
38
http .HandleFunc ("/callback" , func (w http.ResponseWriter , req * http.Request ) {
39
39
log .Println ("/callback called..." )
40
40
41
- cb , err := webhook .ParseRequestWithOption (channelSecret , req , & webhook.ParseOption {
42
- SkipSignatureValidation : func () bool { return true },
43
- })
41
+ cb , err := webhook .ParseRequest (channelSecret , req )
44
42
if err != nil {
45
43
log .Printf ("Cannot parse request: %+v\n " , err )
46
44
if errors .Is (err , webhook .ErrInvalidSignature ) {
You can’t perform that action at this time.
0 commit comments