line 2.1.0.1 → 2.1.0.2
raw patch · 4 files changed
+9/−5 lines, 4 files
Files
- CHANGELOG.md +4/−0
- line.cabal +1/−1
- src/Line/Messaging/Webhook.hs +1/−1
- test/Line/Messaging/WebhookSpec.hs +3/−3
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 2.1.0.2 (6 Dec 2016)++* Doc and test fixes to use POST for webhooks+ ## 2.1.0.1 (5 Dec 2016) * Specify lower bounds in cabal file
line.cabal view
@@ -1,5 +1,5 @@ name: line-version: 2.1.0.1+version: 2.1.0.2 synopsis: Haskell SDK for the LINE API homepage: https://github.com/noraesae/line license: BSD3
src/Line/Messaging/Webhook.hs view
@@ -99,7 +99,7 @@ -- @ -- main :: IO () -- main = scotty 3000 $ do--- get "/webhook" $ webhookAction handler defaultOnFailure'+-- post "/webhook" $ webhookAction handler defaultOnFailure' -- -- handler :: [Event] -> IO () -- handler events = forM_ events handleEvent
test/Line/Messaging/WebhookSpec.hs view
@@ -44,7 +44,7 @@ describe "WAI webhook" $ let waiApp = return $ webhookApp "some-secret" (const $ return ()) defaultOnFailure- webhookReq sec body hasCorrectSig = request "GET" "/" headers body+ webhookReq sec body hasCorrectSig = request "POST" "/" headers body where sig = if hasCorrectSig then createSig sec body else "wrong sig" headers = [ ("X-Line-Signature", sig) ]@@ -62,8 +62,8 @@ describe "Scotty webhook" $ let waiApp = Scotty.scottyApp $- Scotty.get "/" $ webhookAction "some-secret" (const $ return ()) defaultOnFailure'- webhookReq sec body hasCorrectSig = request "GET" "/" headers body+ Scotty.post "/" $ webhookAction "some-secret" (const $ return ()) defaultOnFailure'+ webhookReq sec body hasCorrectSig = request "POST" "/" headers body where sig = if hasCorrectSig then createSig sec body else "wrong sig" headers = [ ("X-Line-Signature", sig) ]