Skip to content

Commit ae72098

Browse files
committed
Merge branch 'feature/cookie' into develop/1.8
2 parents 5fdf5eb + 05a4e31 commit ae72098

File tree

55 files changed

+1862
-93
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1862
-93
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
99
_Changes since 1.7.3_
1010

1111
### Added
12+
- Cookie support (Default disabled. Enable in the Subproject Configuration Dialog)
1213
- On pre-flight, update environment variables according to request headers, query parameters and bodies
1314
- A "Save Raw" button at the response viewer to save raw response body to a file
1415

144 KB
Loading
135 KB
Loading
84.9 KB
Loading
30 KB
Loading
137 KB
Loading

doc/features/cookie.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Cookie
3+
---
4+
5+
# HTTP Cookie
6+
7+
## Enable or Disable
8+
9+
To enable Cookie support, first enable in the Subproject Configuration dialog. It would affect the whole Subproject.
10+
11+
By default, Cookie is disabled.
12+
13+
![Enable Cookie Step 1](../cookie-enable-step-1.png)
14+
15+
![Enable Cookie Step 2](../cookie-enable-step-2.png)
16+
17+
## Receive Cookie
18+
19+
To receive Cookie from servers, an environment must be selected or created. Cookie storage is not shared among multiple environments.
20+
21+
## Send Cookie
22+
23+
If Cookie is enabled, the Cookie storing in the storage would be applied to matching requests automatically. To examine what Cookie would be applied, check the Cookie tab in the Request Example level.
24+
25+
To send custom Cookie in additional to stored Cookie, one can insert Cookie in the Cookie tab in the Request Example level:
26+
27+
![Cookie Editor in Request Example](../cookie-editor-in-request-example.png)
28+
29+
or in the Environment level:
30+
31+
![Cookie Editor 1 in Environment](../cookie-editor-1-in-environment.png)
32+
33+
![Cookie Editor 2 in Environment](../cookie-editor-2-in-environment.png)
34+
35+
## Variables and Functions
36+
37+
Variables and functions are supported only in the "value" field.
38+
39+
However, Cookie containing variable and function macros in the "Set-Cookie" response headers are automatically dropped for security reasons.
40+
41+
For example, in the following response, only the cookie "cookie1" would be stored.
42+
43+
```
44+
HTTP/1.1 204 No Content
45+
Set-Cookie: cookie0=some-${{var}}; Max-Age=3600
46+
Set-Cookie: cookie1=AbcDE; Max-Age=3600
47+
```
48+
49+
## Applicable Transports
50+
51+
All types of supported HTTP transport, including WebSocket, GraphQL and gRPC, support Cookie. Note that response headers "Set-Cookie" only take effect after the entire request is completed.

doc/features/user-script.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ fun Request<*>.getResolvedUri(): String
7676
* Get variables merged from the selected environment, the base request example and the selected request example.
7777
*/
7878
fun Request<*>.getApplicableVariables(): Map<String, String>
79+
80+
fun Request<*>.getApplicableCookies(): Map<String, String>
7981
```
8082

8183
#### `MutableRequest`

doctave.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ navigation:
1515
- path: doc/features/environments.md
1616
- path: doc/features/ssl-configuration.md
1717
- path: doc/features/functions.md
18+
- path: doc/features/cookie.md
1819
- path: doc/features/user-script.md
1920
- path: doc/features/post-flight-actions.md
2021
- path: doc/features/viewing-responses.md
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)