브라우저의 Gateway·Game tRPC 클라이언트를 POST JSON 전송으로 통일하고 서버의 query method override를 허용한다. GET mutation 거부 계약과 production Chromium 요청 형태를 회귀 테스트로 고정한다.
13 lines
408 B
TypeScript
13 lines
408 B
TypeScript
/**
|
|
* tRPC keeps procedure semantics in its envelope, so browser inputs belong in a JSON body
|
|
* instead of a percent-encoded URL query string.
|
|
*/
|
|
export const trpcJsonBodyHttpClientOptions = {
|
|
methodOverride: 'POST',
|
|
} as const;
|
|
|
|
/** POST may execute queries, while tRPC still rejects mutations sent as GET. */
|
|
export const trpcJsonBodyHttpServerOptions = {
|
|
allowMethodOverride: true,
|
|
} as const;
|