Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 v8.0.0 instead.

## [v6.0.0](https://github.com/purescript-node/purescript-node-http/releases/tag/v6.0.0) - 2021-02-26

Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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