Skip to content

Commit 6815811

Browse files
committed
fix: set_cookie sameSite/expires/session fields, IndexedDB keyRange omission, bump 0.3.5
- set_cookie now sends all required fields (sameSite defaults to "Lax", session=true when expires=0) to satisfy WebKit's strict validation - Removed omitempty from Cookie.SameSite so it's always serialized - get_indexed_db_data omits keyRange entirely instead of sending nil/{} which WebKit rejected with "Could not parse key range"
1 parent 04c22c1 commit 6815811

5 files changed

Lines changed: 19 additions & 11 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iwdp-mcp",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"description": "iOS Safari debugging via ios-webkit-debug-proxy — MCP server with full WebKit Inspector Protocol support",
55
"owner": {
66
"name": "nnemirovsky"

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iwdp-mcp",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"description": "iOS Safari debugging via ios-webkit-debug-proxy — MCP server with full WebKit Inspector Protocol support",
55
"mcpServers": {
66
"iwdp-mcp": {

cmd/iwdp-mcp/main.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func lookupInterceptStage(requestID string) string {
5858
func main() {
5959
server := mcp.NewServer(&mcp.Implementation{
6060
Name: "iwdp-mcp",
61-
Version: "0.3.4",
61+
Version: "0.3.5",
6262
}, nil)
6363

6464
registerTools(server)
@@ -247,12 +247,14 @@ type SetResourceCachingDisabledInput struct {
247247
type (
248248
GetCookiesInput struct{}
249249
SetCookieInput struct {
250-
Name string `json:"name"`
251-
Value string `json:"value"`
252-
Domain string `json:"domain,omitempty"`
253-
Path string `json:"path,omitempty"`
254-
Secure bool `json:"secure,omitempty"`
255-
HTTPOnly bool `json:"http_only,omitempty"`
250+
Name string `json:"name"`
251+
Value string `json:"value"`
252+
Domain string `json:"domain,omitempty"`
253+
Path string `json:"path,omitempty"`
254+
Expires float64 `json:"expires,omitempty" jsonschema:"expiry as Unix timestamp in seconds (0 or omit for session cookie)"`
255+
Secure bool `json:"secure,omitempty"`
256+
HTTPOnly bool `json:"http_only,omitempty"`
257+
SameSite string `json:"same_site,omitempty" jsonschema:"cookie SameSite attribute: None, Lax, or Strict (default: Lax)"`
256258
}
257259
)
258260

@@ -1159,13 +1161,20 @@ func registerTools(server *mcp.Server) {
11591161
if err != nil {
11601162
return nil, OKOutput{}, err
11611163
}
1164+
sameSite := input.SameSite
1165+
if sameSite == "" {
1166+
sameSite = "Lax"
1167+
}
11621168
cookie := webkit.Cookie{
11631169
Name: input.Name,
11641170
Value: input.Value,
11651171
Domain: input.Domain,
11661172
Path: input.Path,
1173+
Expires: input.Expires,
1174+
Session: input.Expires == 0,
11671175
Secure: input.Secure,
11681176
HTTPOnly: input.HTTPOnly,
1177+
SameSite: sameSite,
11691178
}
11701179
return nil, ok(), tools.SetCookie(ctx, c, cookie)
11711180
})

internal/tools/storage.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ func GetIndexedDBData(ctx context.Context, client *webkit.Client, securityOrigin
163163
"indexName": "",
164164
"skipCount": skipCount,
165165
"pageSize": pageSize,
166-
"keyRange": nil,
167166
})
168167
if err != nil {
169168
return nil, err

internal/webkit/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ type Cookie struct {
234234
HTTPOnly bool `json:"httpOnly"`
235235
Secure bool `json:"secure"`
236236
Session bool `json:"session"`
237-
SameSite string `json:"sameSite,omitempty"`
237+
SameSite string `json:"sameSite"`
238238
}
239239

240240
// --- DOMStorage types ---

0 commit comments

Comments
 (0)