From 6fb894ae9a9001c9a4d82495d09a0cf80b0fb796 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 29 Apr 2022 09:26:28 -0500 Subject: [PATCH 1/5] Update node-streams to v7.0.0 --- bower.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 5c02e4b..9de0635 100644 --- a/bower.json +++ b/bower.json @@ -22,8 +22,8 @@ "purescript-foreign-object": "^4.0.0", "purescript-maybe": "^6.0.0", "purescript-node-buffer": "^8.0.0", - "purescript-node-net": "^3.0.0", - "purescript-node-streams": "^6.0.0", + "purescript-node-net": "^4.0.0", + "purescript-node-streams": "^7.0.0", "purescript-node-url": "^6.0.0", "purescript-nullable": "^6.0.0", "purescript-options": "^7.0.0", From 4155ffb9af4ec1febcacbe168c02618ab6fc189a Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 29 Apr 2022 09:30:58 -0500 Subject: [PATCH 2/5] Update changelog --- CHANGELOG.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb2cfe0..48ddebd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,16 +12,14 @@ Bugfixes: Other improvements: -## [v7.0.0](https://github.com/purescript-node/purescript-node-http/releases/tag/v7.0.0) - 2022-04-28 +## [v8.0.0](https://github.com/purescript-node/purescript-node-http/releases/tag/v8.0.0) - 2022-04-29 Breaking changes: - Update project and deps to PureScript v0.15.0 (#41 by @JordanMartinez, @sigma-andex) -New features: - -Bugfixes: +## [v7.0.0](https://github.com/purescript-node/purescript-node-http/releases/tag/v7.0.0) - 2022-04-28 -Other improvements: +Due to implementing a breaking change incorrectly, use v10.0.0 instead. ## [v6.0.0](https://github.com/purescript-node/purescript-node-http/releases/tag/v6.0.0) - 2021-02-26 From 59a3315d12dd945bb019b8584222672903121f1a Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 29 Apr 2022 09:40:35 -0500 Subject: [PATCH 3/5] Fix tests --- test/Main.purs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Main.purs b/test/Main.purs index ac8c103..4d23bbf 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -44,7 +44,7 @@ respond req res = do ] setHeader res "Content-Type" "text/html" _ <- writeString outputStream UTF8 html mempty - end outputStream (pure unit) + end outputStream (const $ pure unit) "POST" -> void $ pipe inputStream outputStream _ -> unsafeCrashWith "Unexpected HTTP method" @@ -139,13 +139,13 @@ simpleReq :: String -> Effect Unit simpleReq uri = do log ("GET " <> uri <> ":") req <- Client.requestFromURI uri logResponse - end (Client.requestAsStream req) (pure unit) + end (Client.requestAsStream req) (const $ pure unit) complexReq :: Options Client.RequestOptions -> Effect Unit complexReq opts = do log $ optsR.method <> " " <> optsR.protocol <> "//" <> optsR.hostname <> ":" <> optsR.port <> optsR.path <> ":" req <- Client.request opts logResponse - end (Client.requestAsStream req) (pure unit) + end (Client.requestAsStream req) (const $ pure unit) where optsR = unsafeCoerce $ options opts @@ -190,7 +190,7 @@ testUpgrade = do unsafeCrashWith "Unexpected response to simple request on `testUpgrade`" else pure unit - end (Client.requestAsStream reqSimple) (pure unit) + end (Client.requestAsStream reqSimple) (const $ pure unit) {- These two requests test that the upgrade callback is called and that it has access to the original request and can write to the underlying TCP socket @@ -206,7 +206,7 @@ testUpgrade = do unsafeCrashWith "Unexpected response to upgrade request on `testUpgrade`" else pure unit - end (Client.requestAsStream reqUpgrade) (pure unit) + end (Client.requestAsStream reqUpgrade) (const $ pure unit) let wsHeaders = Client.RequestHeaders $ fromFoldable [ Tuple "Connection" "upgrade" @@ -220,5 +220,5 @@ testUpgrade = do unsafeCrashWith "Unexpected response to websocket upgrade request on `testUpgrade`" else pure unit - end (Client.requestAsStream reqWSUpgrade) (pure unit) + end (Client.requestAsStream reqWSUpgrade) (const $ pure unit) pure unit From 3cdd111bd268a0a0593df88808b1da760499ed39 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 29 Apr 2022 09:40:45 -0500 Subject: [PATCH 4/5] Fix unused variable --- test/Main.purs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Main.purs b/test/Main.purs index 4d23bbf..8370e59 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -168,7 +168,7 @@ testUpgrade = do log "Listening on port 3000." sendRequests where - handleUpgrade req socket buffer = do + handleUpgrade req socket _ = do let upgradeHeader = fromMaybe "" $ lookup "upgrade" $ requestHeaders req if upgradeHeader == "websocket" then void $ Socket.writeString From 414ab96bdf109b715f165d9222c3facb31208c86 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 29 Apr 2022 09:46:02 -0500 Subject: [PATCH 5/5] Fix copy-paste mistake --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48ddebd..ce00c0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ Breaking changes: ## [v7.0.0](https://github.com/purescript-node/purescript-node-http/releases/tag/v7.0.0) - 2022-04-28 -Due to implementing a breaking change incorrectly, use v10.0.0 instead. +Due to implementing a breaking change incorrectly, use v8.0.0 instead. ## [v6.0.0](https://github.com/purescript-node/purescript-node-http/releases/tag/v6.0.0) - 2021-02-26