rabbah commented on a change in pull request #4494: Akka http server responds
HEAD request as GET
URL:
https://github.com/apache/incubator-openwhisk/pull/4494#discussion_r298159914
##########
File path:
tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala
##########
@@ -305,6 +305,35 @@ class WskWebActionsTests extends TestHelpers with
WskTestHelpers with RestUtil w
response.body.asByteArray shouldBe Base64.getDecoder().decode(png)
}
+ /**
+ * Tests web action for HEAD requests
+ */
+ it should "create a web action making a HEAD request" in
withAssetCleaner(wskprops) { (wp, assetHelper) =>
+ val name = "webactionHead"
+ val file = Some(TestUtils.getTestActionFilename("echo-web-http-head.js"))
+ val host = getServiceURL()
+ val url = s"$host$testRoutePath/$namespace/default/$name"
+
+ assetHelper.withCleaner(wsk.action, name) { (action, _) =>
+ action.create(name, file, web = Some("true"), annotations =
Map("require-whisk-auth" -> true.toJson))
+ }
+
+ val unauthorizedResponse = RestAssured.given().config(sslconfig).head(url)
+ unauthorizedResponse.statusCode shouldBe 401
Review comment:
and then remove this unless this is important to the test.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services