mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 14:35:03 +00:00
Added test requests for cookies and related changes in testbench server
In bruno-testbench(packages/bruno-tests) server - Added support for customising response status-code in `POST /api/echo/custom` API using `statusCode` field - Added `/api/echo/trace` API which returns all the request details as an JSON response - Added SSL support for `localhost` in dev env to test HTTPS requests
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
meta {
|
||||
name: test secure+https,http
|
||||
seq: 3
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
meta {
|
||||
name: set and verify
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{remote_host}}/api/echo/custom
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"type": "text/plain",
|
||||
"headers": {
|
||||
"set-cookie": [
|
||||
"secure-https=val; Secure",
|
||||
"nosecure-https-key2=val"
|
||||
],
|
||||
"location": "/api/echo/trace"
|
||||
},
|
||||
"statusCode": 302,
|
||||
"content": "hello"
|
||||
}
|
||||
}
|
||||
|
||||
assert {
|
||||
res.body.headers.cookie: contains secure-https=val
|
||||
res.body.headers.cookie: contains nosecure-https-key2=val
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
meta {
|
||||
name: verify the cookie with http
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{remote_host_http}}/api/echo/trace
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.body.headers.cookie: notContains secure-https=val
|
||||
res.body.headers.cookie: contains nosecure-https-key2=val
|
||||
}
|
||||
Reference in New Issue
Block a user