Skip to content

Commit

Permalink
0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Dec 24, 2019
1 parent b79baab commit e5570f2
Show file tree
Hide file tree
Showing 36 changed files with 46 additions and 42 deletions.
2 changes: 1 addition & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object cask extends CaskModule {
def ivyDeps = Agg(
ivy"org.scala-lang:scala-reflect:${scalaVersion()}",
ivy"io.undertow:undertow-core:2.0.13.Final",
ivy"com.lihaoyi::upickle:0.9.0"
ivy"com.lihaoyi::upickle:0.9.1"
)
def compileIvyDeps = Agg(ivy"com.lihaoyi::acyclic:0.2.0")
def scalacOptions = Seq("-P:acyclic:force")
Expand Down
2 changes: 1 addition & 1 deletion cask/src/cask/endpoints/JsonEndpoint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ trait JsonData extends Response.Data
object JsonData extends DataCompanion[JsonData]{
implicit class JsonDataImpl[T: upickle.default.Writer](t: T) extends JsonData{
def write(out: OutputStream) = {
upickle.default.writable(t).writeBytesTo(out)
upickle.default.stream(t).writeBytesTo(out)
out.flush()
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/compress/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/compress2/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/compress3/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
4 changes: 2 additions & 2 deletions example/cookies/app/test/src/ExampleTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ object ExampleTests extends TestSuite{
val tests = Tests{
test("Cookies") - withServer(Cookies){ host =>
val sess = requests.Session()
sess.get(s"$host/read-cookie").statusCode ==> 400
sess.get(s"$host/read-cookie", check = false).statusCode ==> 400
sess.get(s"$host/store-cookie")
sess.get(s"$host/read-cookie").text() ==> "the username"
sess.get(s"$host/read-cookie").statusCode ==> 200
sess.get(s"$host/delete-cookie")
sess.get(s"$host/read-cookie").statusCode ==> 400
sess.get(s"$host/read-cookie", check = false).statusCode ==> 400

}
}
Expand Down
2 changes: 1 addition & 1 deletion example/cookies/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/decorated/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/decorated2/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
4 changes: 2 additions & 2 deletions example/endpoints/app/test/src/ExampleTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ object ExampleTests extends TestSuite{
test("Endpoints") - withServer(Endpoints){ host =>
requests.get(s"$host/echo/200").text() ==> "Echo 200"
requests.get(s"$host/echo/200").statusCode ==> 200
requests.get(s"$host/echo/400").text() ==> "Echo 400"
requests.get(s"$host/echo/400").statusCode ==> 400
requests.get(s"$host/echo/400", check = false).text() ==> "Echo 400"
requests.get(s"$host/echo/400", check = false).statusCode ==> 400
}
}
}
2 changes: 1 addition & 1 deletion example/endpoints/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/formJsonPost/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1"
)
}
}
2 changes: 1 addition & 1 deletion example/httpMethods/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
4 changes: 2 additions & 2 deletions example/minimalApplication/app/test/src/ExampleTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ object ExampleTests extends TestSuite{
success.text() ==> "Hello World!"
success.statusCode ==> 200

requests.get(s"$host/doesnt-exist").statusCode ==> 404
requests.get(s"$host/doesnt-exist", check = false).statusCode ==> 404

requests.post(s"$host/do-thing", data = "hello").text() ==> "olleh"

requests.get(s"$host/do-thing").statusCode ==> 404
requests.get(s"$host/do-thing", check = false).statusCode ==> 404
}
}
}
2 changes: 1 addition & 1 deletion example/minimalApplication/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
4 changes: 2 additions & 2 deletions example/minimalApplication2/app/test/src/ExampleTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ object ExampleTests extends TestSuite{
success.text() ==> "Hello World!"
success.statusCode ==> 200

requests.get(s"$host/doesnt-exist").statusCode ==> 404
requests.get(s"$host/doesnt-exist", check = false).statusCode ==> 404

requests.post(s"$host/do-thing", data = "hello").text() ==> "olleh"

requests.get(s"$host/do-thing").statusCode ==> 404
requests.get(s"$host/do-thing", check = false).statusCode ==> 404
}
}
}
2 changes: 1 addition & 1 deletion example/minimalApplication2/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/redirectAbort/app/test/src/ExampleTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object ExampleTests extends TestSuite{
val tests = Tests{

test("RedirectAbort") - withServer(RedirectAbort){ host =>
val resp = requests.get(s"$host/")
val resp = requests.get(s"$host/", check = false)
resp.statusCode ==> 401
resp.history.get.statusCode ==> 301
}
Expand Down
2 changes: 1 addition & 1 deletion example/redirectAbort/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/scalatags/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/staticFiles/app/test/src/ExampleTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object ExampleTests extends TestSuite{
requests.get(s"$host/static/resource2/cask/example.txt").text() ==>
"the quick brown fox jumps over the lazy dog"

requests.get(s"$host/static/file/../../../build.sc").statusCode ==> 404
requests.get(s"$host/static/file/../../../build.sc", check = false).statusCode ==> 404
}

}
Expand Down
2 changes: 1 addition & 1 deletion example/staticFiles/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)

def forkWorkingDir = build.millSourcePath
Expand Down
2 changes: 1 addition & 1 deletion example/staticFiles2/app/test/src/ExampleTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object ExampleTests extends TestSuite{
requests.get(s"$host/static/resource2/cask/example.txt").text() ==>
"the quick brown fox jumps over the lazy dog"

requests.get(s"$host/static/file/../../../build.sc").statusCode ==> 404
requests.get(s"$host/static/file/../../../build.sc", check = false).statusCode ==> 404
}

}
Expand Down
2 changes: 1 addition & 1 deletion example/staticFiles2/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)

def forkWorkingDir = build.millSourcePath
Expand Down
2 changes: 1 addition & 1 deletion example/todo/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/todoApi/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/todoDb/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
4 changes: 2 additions & 2 deletions example/twirl/build.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mill._, scalalib._
import $ivy.`com.lihaoyi::mill-contrib-twirllib:0.4.1-4-158d11`
import $ivy.`com.lihaoyi::mill-contrib-twirllib:$MILL_VERSION`

trait AppModule extends ScalaModule with mill.twirllib.TwirlModule{
def scalaVersion = "2.13.0"
Expand All @@ -16,7 +16,7 @@ trait AppModule extends ScalaModule with mill.twirllib.TwirlModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
6 changes: 3 additions & 3 deletions example/variableRoutes/app/test/src/ExampleTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ object ExampleTests extends TestSuite{

val tests = Tests{
test("VariableRoutes") - withServer(VariableRoutes){ host =>
val noIndexPage = requests.get(host)
val noIndexPage = requests.get(host, check = false)
noIndexPage.statusCode ==> 404

requests.get(s"$host/user/lihaoyi").text() ==> "User lihaoyi"

requests.get(s"$host/user").statusCode ==> 404
requests.get(s"$host/user", check = false).statusCode ==> 404


requests.get(s"$host/post/123?param=xyz&param=abc").text() ==>
"Post 123 ArraySeq(xyz, abc)"

requests.get(s"$host/post/123").text() ==>
requests.get(s"$host/post/123", check = false).text() ==>
"""Missing argument: (param: Seq[String])
|
|Arguments provided did not match expected signature:
Expand Down
2 changes: 1 addition & 1 deletion example/variableRoutes/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
)
}
}
2 changes: 1 addition & 1 deletion example/websockets/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
ivy"org.asynchttpclient:async-http-client:2.5.2"
)
}
Expand Down
2 changes: 1 addition & 1 deletion example/websockets2/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
ivy"org.asynchttpclient:async-http-client:2.5.2"
)
}
Expand Down
2 changes: 1 addition & 1 deletion example/websockets3/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
ivy"org.asynchttpclient:async-http-client:2.5.2"
)
}
Expand Down
2 changes: 1 addition & 1 deletion example/websockets4/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait AppModule extends ScalaModule{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.1",
ivy"com.lihaoyi::requests::0.3.0",
ivy"com.lihaoyi::requests::0.4.1",
ivy"org.asynchttpclient:async-http-client:2.5.2"
)
}
Expand Down
2 changes: 1 addition & 1 deletion mill
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This is a wrapper script, that automatically download mill from GitHub release pages
# You can give the required mill version with MILL_VERSION env variable
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
DEFAULT_MILL_VERSION=0.5.1
DEFAULT_MILL_VERSION=0.5.6

set -e

Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ courtesy of EJ Technologies

## Changelog

### 0.4.1

- Bump uPickle, Requests versions

### 0.3.7

- Add `SameSite` cookie attribute
Expand Down

0 comments on commit e5570f2

Please sign in to comment.