Skip to content

Commit ee28ff4

Browse files
beautyfreeclaude
andcommitted
v0.2.8: fix 415 on argument-less tRPC mutations
tRPC v11 requires Content-Type: application/json on every mutation, even ones with no input. Our client skipped the header + body when input was undefined, so app_update_download / app_update_check / close_quit / etc. all hit UNSUPPORTED_MEDIA_TYPE before reaching the procedure. Always send the header and a `{}` body on POST. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d9f5ed2 commit ee28ff4

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "skiller",
3-
"version": "0.2.7",
3+
"version": "0.2.8",
44
"description": "A desktop app for managing AI agent skills across Claude Code, Cursor, Copilot, Gemini CLI, and more",
55
"license": "MIT",
66
"author": {

src/mainview/lib/native.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,12 @@ async function callTrpcProcedure<T>(
203203
if (input !== undefined) {
204204
url += `?input=${encodeURIComponent(JSON.stringify(input))}`
205205
}
206-
} else if (input !== undefined) {
206+
} else {
207+
// tRPC v11 requires Content-Type: application/json on every mutation,
208+
// even ones with no input (it rejects the body-less POST with 415
209+
// UNSUPPORTED_MEDIA_TYPE before reaching the procedure).
207210
init.headers = { 'Content-Type': 'application/json' }
208-
init.body = JSON.stringify(input)
211+
init.body = input === undefined ? '{}' : JSON.stringify(input)
209212
}
210213
const res = await trpcFetch(url, init)
211214
const payload = (await res.json()) as TrpcSingleResponse<T>

0 commit comments

Comments
 (0)