Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openwhisk-runtime-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Groundhog
openwhisk-runtime-python
Commits
18c10777
Commit
18c10777
authored
8 years ago
by
Rodric Rabbah
Committed by
Stephen Fink
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Tweak server configurations. Add comments.
Add test for max URL path. Match nginx max url.
parent
f318b947
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/whisk/core/cli/test/WskWebActionsTests.scala
+25
-5
25 additions, 5 deletions
tests/src/whisk/core/cli/test/WskWebActionsTests.scala
with
25 additions
and
5 deletions
tests/src/whisk/core/cli/test/WskWebActionsTests.scala
+
25
−
5
View file @
18c10777
...
@@ -40,6 +40,8 @@ class WskWebActionsTests
...
@@ -40,6 +40,8 @@ class WskWebActionsTests
with
WskTestHelpers
with
WskTestHelpers
with
RestUtil
{
with
RestUtil
{
val
MAX_URL_LENGTH
=
8192
// 8K matching nginx default
implicit
val
wskprops
=
WskProps
()
implicit
val
wskprops
=
WskProps
()
val
wsk
=
new
Wsk
val
wsk
=
new
Wsk
val
namespace
=
WskAdmin
.
getUser
(
wskprops
.
authKey
).
_2
val
namespace
=
WskAdmin
.
getUser
(
wskprops
.
authKey
).
_2
...
@@ -56,11 +58,29 @@ class WskWebActionsTests
...
@@ -56,11 +58,29 @@ class WskWebActionsTests
action
.
create
(
name
,
file
,
annotations
=
Map
(
"web-export"
->
true
.
toJson
))
action
.
create
(
name
,
file
,
annotations
=
Map
(
"web-export"
->
true
.
toJson
))
}
}
val
response
=
RestAssured
.
given
().
config
(
sslconfig
).
val
host
=
getServiceURL
()
get
(
getServiceURL
()
+
s
"/api/v1/experimental/web/$namespace/default/webaction.text/a?a=A"
)
val
requestPath
=
host
+
s
"/api/v1/experimental/web/$namespace/default/webaction.text/a?a="
val
padAmount
=
MAX_URL_LENGTH
-
requestPath
.
length
Seq
((
"A"
,
200
),
(
"A"
*
padAmount
,
200
),
// ideally the bad case is just +1 but there's some differences
// in how characters are counted i.e., whether these count "https://:443"
// or not; it seems sufficient to test right around the boundary
(
"A"
*
(
padAmount
+
100
),
414
))
.
foreach
{
case
(
pad
,
code
)
=>
val
url
=
(
requestPath
+
pad
)
val
response
=
RestAssured
.
given
().
config
(
sslconfig
).
get
(
url
)
val
responseCode
=
response
.
statusCode
response
.
statusCode
()
should
be
(
200
)
withClue
(
s
"response code: $responseCode, url length: ${url.length}, pad amount: ${pad.length}, url: $url"
)
{
response
.
body
().
asString
()
shouldBe
"A"
responseCode
shouldBe
code
if
(
code
==
200
)
{
response
.
body
().
asString
()
shouldBe
pad
}
else
{
response
.
body
().
asString
()
should
include
(
"414 Request-URI Too Large"
)
// from nginx
}
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment