René's URL Explorer Experiment


Title: pm-dispatch(server): the 256 KiB body cap is measured in UTF-16 code units, not bytes — a 300 KB CJK body passes readJsonBody's 'too large' check · Issue #3010 · developing-today/code · GitHub

Open Graph Title: pm-dispatch(server): the 256 KiB body cap is measured in UTF-16 code units, not bytes — a 300 KB CJK body passes readJsonBody's 'too large' check · Issue #3010 · developing-today/code

X Title: pm-dispatch(server): the 256 KiB body cap is measured in UTF-16 code units, not bytes — a 300 KB CJK body passes readJsonBody's 'too large' check · Issue #3010 · developing-today/code

Description: Problem pm-dispatch's request body cap is named and documented as a byte cap, but it is measured in UTF-16 code units — so a body well over the cap in bytes passes the check whenever the prompt text is non-ASCII. Evidence pm-stack/dispat...

Open Graph Description: Problem pm-dispatch's request body cap is named and documented as a byte cap, but it is measured in UTF-16 code units — so a body well over the cap in bytes passes the check whenever the prompt tex...

X Description: Problem pm-dispatch's request body cap is named and documented as a byte cap, but it is measured in UTF-16 code units — so a body well over the cap in bytes passes the check whenever the prompt...

Opengraph URL: https://github.com/developing-today/code/issues/3010

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pm-dispatch(server): the 256 KiB body cap is measured in UTF-16 code units, not bytes — a 300 KB CJK body passes readJsonBody's 'too large' check","articleBody":"## Problem\n\npm-dispatch's request body cap is named and documented as a byte cap, but it is measured in UTF-16 code units — so a body well over the cap in bytes passes the check whenever the prompt text is non-ASCII.\n\n## Evidence\n\n- `pm-stack/dispatch/src/server.ts:36` (main `fbfd1454`): `const MAX_BODY_BYTES = 256 * 1024;`\n- `server.ts:47-48`, `readJsonBody`: `const text = await req.text(); if (text.length > MAX_BODY_BYTES) throw new ValidationError(\"body: too large\");` — `String.length` counts UTF-16 code units, not bytes.\n- Verified this run with the runtime's own semantics: a string of 100,000 CJK characters has `length` 100,000 (≤ 262,144, so it passes) but encodes to 300,000 UTF-8 bytes — ~17% over the stated cap. Worst common cases: CJK text passes at up to ~3× the cap in bytes (786,432 bytes); astral-plane characters (emoji) at up to ~2× (2 code units per 4-byte character, 524,288 bytes).\n\n## Why it matters\n\n- The cap is the intake boundary's only size guard before `JSON.parse` and packet construction on both authenticated endpoints (`POST /v1/sessions`, `POST /v1/tasks`). Its stated unit is bytes; the enforced unit is code units, so the guard the operator thinks is in place (256 KiB) is not the guard that runs (up to ~768 KiB of actual body).\n- Dispatch prompts are exactly the traffic that goes non-ASCII: callers paste prompts with CJK text, emoji and smart punctuation, so the miscount is on the common path, not an exotic one.\n- Nothing else in the service re-checks size: the packet, issue body and queue task all carry the prompt onward at whatever size passed.\n\n## Acceptance criteria\n\n- `readJsonBody` rejects on the body's UTF-8 byte length (e.g. `new TextEncoder().encode(text).length` or `Buffer.byteLength(text)`), keeping the same `MAX_BODY_BYTES` value and the same `ValidationError(\"body: too large\")` behavior for ASCII bodies.\n- A test in `pm-stack/dispatch/test/` pins both sides of the boundary with multibyte text: a body just under the cap in bytes passes; a body under the cap in code units but over it in bytes is rejected.\n- Existing dispatch tests still pass (`bun test` in `pm-stack/dispatch`).\n\nFound by new-issue-creator-code-a, run 2026-10-31; verified by direct read of `server.ts` on main `fbfd1454` plus a runtime semantics check this run (100,000 CJK chars: length 100,000, 300,000 UTF-8 bytes). Dedup: searched open+closed issues for MAX_BODY_BYTES / dispatch body size / readJsonBody — no hits; the #2668 design doc's boundary rule covers shape/scope validation of fields, not the body-size unit.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-31T09:43:54Z","url":"https://github.com/developing-today/code/issues/3010"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5415401f-b461-f2cb-d24a-340f46fb59b2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA5DA:3C042B:348C01:44E0D6:6B0617F2
html-safe-noncecd33226728f35a3d98990a1714284aad4eb3e6fff0c3bc7e6e4181b4aba8787e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNURBOjNDMDQyQjozNDhDMDE6NDRFMEQ2OjZCMDYxN0YyIiwidmlzaXRvcl9pZCI6IjIxNDY3NzQxNDI2NzMwOTg3MzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac38e0f8881c686eb8dc77a58d80c538be9db3aa3e3250b3b763e36c7c1b63d9ec
hovercard-subject-tagissue:6133449485
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/3010/issue_layout
twitter:imagehttps://opengraph.githubassets.com/30c5567aa7a9b0ad1bf538b44e1540aeb6eced455831ead9caeeb8bd927932a5/developing-today/code/issues/3010
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/30c5567aa7a9b0ad1bf538b44e1540aeb6eced455831ead9caeeb8bd927932a5/developing-today/code/issues/3010
og:image:altProblem pm-dispatch's request body cap is named and documented as a byte cap, but it is measured in UTF-16 code units — so a body well over the cap in bytes passes the check whenever the prompt tex...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedezren39
hostnamegithub.com
expected-hostnamegithub.com
None97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374
turbo-cache-controlno-preview
go-importgithub.com/developing-today/code git https://github.com/developing-today/code.git
octolytics-dimension-user_id26439447
octolytics-dimension-user_logindeveloping-today
octolytics-dimension-repository_id627308783
octolytics-dimension-repository_nwodeveloping-today/code
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id627308783
octolytics-dimension-repository_network_root_nwodeveloping-today/code
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release866f202ebf7ac5aff8f633417d9fd8a53818a977
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/developing-today/code/issues/3010#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F3010
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F3010
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=developing-today%2Fcode
Reloadhttps://github.com/developing-today/code/issues/3010
Reloadhttps://github.com/developing-today/code/issues/3010
Reloadhttps://github.com/developing-today/code/issues/3010
developing-todayhttps://github.com/developing-today
codehttps://github.com/developing-today/code
Codehttps://github.com/developing-today/code
Issues1.1k (1.1k)https://github.com/developing-today/code/issues
Pull requests144 (144)https://github.com/developing-today/code/pulls
Discussionshttps://github.com/developing-today/code/discussions
Actionshttps://github.com/developing-today/code/actions
Projectshttps://github.com/developing-today/code/projects
Wikihttps://github.com/developing-today/code/wiki
Security and qualityhttps://github.com/developing-today/code/security
Insightshttps://github.com/developing-today/code/insights
https://github.com/developing-today/code
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/3010
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/3010
#3682https://github.com/developing-today/code/pull/3682
pm-dispatch(server): the 256 KiB body cap is measured in UTF-16 code units, not bytes — a 300 KB CJK body passes readJsonBody's 'too large' checkhttps://github.com/developing-today/code/issues/3010#top
#3682https://github.com/developing-today/code/pull/3682
https://github.com/dezren39
app/pm-stackhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fpm-stack%22
effort/xshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fxs%22
kind/bughttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
priority/lowhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Flow%22
source/creatorhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fcreator%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/3010#issue-6133449485
#2668https://github.com/developing-today/code/issues/2668
Nexthttps://github.com/developing-today/code/issues/3010?timeline_page=1
dezren39https://github.com/dezren39
kind/bughttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
status/needs-triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22
source/creatorhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fcreator%22
priority/lowhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Flow%22
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
effort/xshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fxs%22
app/pm-stackhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fpm-stack%22
on Oct 31, 2026https://github.com/developing-today/code/issues/3010#event-34764723745
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/3010#issuecomment-6541837644
pm-dispatch(server): the 256 KiB body cap is measured in UTF-16 code units, not bytes — a 300 KB CJK body passes readJsonBody's 'too large' check #3010https://github.com/developing-today/code/issues/3010
pm-dispatch(server): the 256 KiB body cap is measured in UTF-16 code units, not bytes — a 300 KB CJK body passes readJsonBody's 'too large' check #3010https://github.com/developing-today/code/issues/3010
github-actionshttps://github.com/apps/github-actions
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/3010#event-34766522038
dezren39https://github.com/dezren39
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
status/needs-triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
on Nov 1, 2026https://github.com/developing-today/code/issues/3010#event-34829214461
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 1, 2026https://github.com/developing-today/code/issues/3010#issuecomment-6557576946
pm-dispatch(server): the 256 KiB body cap is measured in UTF-16 code units, not bytes — a 300 KB CJK body passes readJsonBody's 'too large' check #3010https://github.com/developing-today/code/issues/3010
dezren39https://github.com/dezren39
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
on Nov 1, 2026https://github.com/developing-today/code/issues/3010#event-34829284485
dezren39https://github.com/dezren39
on Nov 1, 2026https://github.com/developing-today/code/issues/3010#event-34831247264
pm-dispatch: measure body cap in UTF-8 bytes in readJsonBody (#3010) (#…https://github.com/developing-today/code/commit/e8a360b287961ba4cfd4acaaae707138e5843b10
#3010https://github.com/developing-today/code/issues/3010
#…https://github.com/developing-today/code/pull/3682
e8a360bhttps://github.com/developing-today/code/commit/e8a360b287961ba4cfd4acaaae707138e5843b10
dezren39https://github.com/dezren39
completedhttps://github.com/developing-today/code/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#3682https://github.com/developing-today/code/pull/3682
on Nov 1, 2026https://github.com/developing-today/code/issues/3010#event-34831247952
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 1, 2026https://github.com/developing-today/code/issues/3010#issuecomment-6558084253
#3682https://github.com/developing-today/code/pull/3682
pm-dispatch: measure body cap in UTF-8 bytes in readJsonBody (#3010) #3682https://github.com/developing-today/code/pull/3682
e8a360bhttps://github.com/developing-today/code/commit/e8a360b287961ba4cfd4acaaae707138e5843b10
c97bfc1https://github.com/developing-today/code/commit/c97bfc181658d1cf2d521cf2ec1b1396f951853d
dezren39https://github.com/dezren39
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
on Nov 1, 2026https://github.com/developing-today/code/issues/3010#event-34831266034
Sign up for freehttps://github.com/signup?return_to=https://github.com/developing-today/code/issues/3010
Sign in to commenthttps://github.com/login?return_to=https://github.com/developing-today/code/issues/3010
dezren39https://github.com/dezren39
app/pm-stackhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fpm-stack%22
effort/xshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fxs%22
kind/bughttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
priority/lowhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Flow%22
source/creatorhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fcreator%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.