Noze 0.5.2 - Swift 3.0.1 GMc
We are happy to announce a minor Noze.io release: 0.5.2, codenamed ‘Basic Nozes with an End’.
The primary news is that Swift 3.0.1 GMc is out for tuxOS and seems to fix the issues we had before (SR-2656, SR-2907). Grab it on Swift.org.
Basic Auth
There is a new basic basic-auth module designed with jshttp/basic-auth in mind. Just basics, stay tuned for more. Example usage:
http.createServer { req, res in
guard let credentials = try? basicAuth.auth(req: req),
credentials.name == "John",
credentials.pass == "Doe"
else {
res.statusCode = 401
res.setHeader("WWW-Authenticate",
"Basic realm=\"Cows Heaven\"")
return res.end()
}
res.end("Welcome to the forbidden zone!")
}
Promises
By popular request you can now directly Swift throw
errors in Promise
closures:
doSomething()
.then {
throw HahaNotReallyDoingItError()
}
.error { err in
print("got error \(err)")
}
Such are captured as regular Promise errors.
Changes in 0.5.2 (from 0.5.0)
- use 3.0.1 GMc on Linux which fixes SR-2907
core
module:- support Swift
throw
in Promise closures
- support Swift
streams
module:- fix: emit a
readable
event (w/ no data) prior emittingend
- fix: emit a
process
module: renamedenviron
toenv
to match Node- new modules:
basicAuth
module
Documentation
In case you haven’t yet, be sure to read those dox:
To understand what Noze.io is about reading the Node Stream Handbook is recommended.
Getting the stuff
Well, as usual, head over to
GitHub
and checkout the master
branch or fetch the 0.5.2
tag.
Happy Basic Nozing with an End!
hh