René's URL Explorer Experiment


Title: Bug: URLSearchParams silently corrupts object values to [object Object] · Issue #3109 · simstudioai/sim · GitHub

Open Graph Title: Bug: URLSearchParams silently corrupts object values to [object Object] · Issue #3109 · simstudioai/sim

X Title: Bug: URLSearchParams silently corrupts object values to [object Object] · Issue #3109 · simstudioai/sim

Description: Description When an API block sends a request with Content-Type: application/x-www-form-urlencoded header and the body contains nested objects or arrays, the values are silently corrupted to the literal string [object Object] instead of ...

Open Graph Description: Description When an API block sends a request with Content-Type: application/x-www-form-urlencoded header and the body contains nested objects or arrays, the values are silently corrupted to the li...

X Description: Description When an API block sends a request with Content-Type: application/x-www-form-urlencoded header and the body contains nested objects or arrays, the values are silently corrupted to the li...

Opengraph URL: https://github.com/simstudioai/sim/issues/3109

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: URLSearchParams silently corrupts object values to [object Object]","articleBody":"## Description\nWhen an API block sends a request with `Content-Type: application/x-www-form-urlencoded` header and the body contains nested objects or arrays, the values are silently corrupted to the literal string `[object Object]` instead of being properly serialized.\n\n## Location\n- **File:** `/apps/sim/tools/http/request.ts`\n- **Line:** 130\n- **Code:** `urlencoded.append(key, String(value))`\n\n## Root Cause\nJavaScript's `String()` function calls `Object.prototype.toString()` which returns `[object Object]` for plain objects. When iterating over body entries and converting values to strings, nested objects and arrays are silently corrupted.\n\n```javascript\nString({nested: \"value\"})  // Returns \"[object Object]\"\nString([1, 2, 3])         // Returns \"1,2,3\" (loses array structure)\n```\n\n## Reproduction Steps\n1. Create an API block in a workflow\n2. Configure it with:\n   - **Method:** POST\n   - **Headers:** `Content-Type: application/x-www-form-urlencoded`\n   - **Body:** `{data: {nested: \"value\"}, items: [1, 2, 3]}`\n3. Execute the workflow\n4. Inspect the actual HTTP request sent\n\n## Expected vs Actual\n**Expected body:**\n```\ndata=%7B%22nested%22%3A%22value%22%7D&items=%5B1%2C2%2C3%5D\n(URL-encoded JSON for nested objects/arrays)\n```\n\n**Actual body:**\n```\ndata=%5Bobject%20Object%5D&items=1%2C2%2C3\n(Corrupted: [object Object] and array loses structure)\n```\n\n## Impact\n- **Severity:** HIGH - Data Corruption\n- **Type:** Silent Data Loss\n- **Scope:** Any API integration using form-urlencoded bodies with nested objects/arrays\n- **Silent Failure:** No error message, request appears to succeed but data is corrupted\n\n## Code Context (lines 116-140)\n```typescript\nif (params.body) {\n  const parsedHeaders = parseTableData(params.headers)\n  const headers = transformTable(parsedHeaders)\n  const contentType = headers['Content-Type'] || headers['content-type']\n\n  if (\n    contentType === 'application/x-www-form-urlencoded' &&\n    typeof params.body === 'object'\n  ) {\n    // Convert JSON object to URL-encoded string\n    const urlencoded = new URLSearchParams()\n    Object.entries(params.body as Record\u003cstring, unknown>).forEach(([key, value]) => {\n      if (value !== undefined && value !== null) {\n        urlencoded.append(key, String(value))  // \u003c-- BUG: String(object) = \"[object Object]\"\n      }\n    })\n    return urlencoded.toString()\n  }\n  return params.body as Record\u003cstring, any>\n}\n```\n\n## Type Safety Issue\nThe body type signature is `Record\u003cstring, unknown>` which explicitly allows objects as values. The code needs to handle this case properly rather than silently corrupting the data.\n\n## Suggested Fix\nReplace line 130:\n\n**Before:**\n```typescript\nurlencoded.append(key, String(value))\n```\n\n**After:**\n```typescript\nurlencoded.append(\n  key,\n  typeof value === 'object' ? JSON.stringify(value) : String(value)\n)\n```\n\nThis ensures:\n- Objects are properly JSON serialized\n- Arrays are converted to JSON arrays instead of comma-separated strings\n- Primitive values continue to work as before\n- No data corruption occurs","author":{"url":"https://github.com/PlaneInABottle","@type":"Person","name":"PlaneInABottle"},"datePublished":"2026-02-01T20:32:10Z","url":"https://github.com/simstudioai/sim/issues/3109"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:edc281e1-d1d2-63e8-0ef1-d10433ca8b02
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBC0C:295278:B42A11:FE4803:6AFB5979
html-safe-noncef59a555977c56712fb52411f76f81ddb68a48e7674da335f891da09ff2287012
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzBDOjI5NTI3ODpCNDJBMTE6RkU0ODAzOjZBRkI1OTc5IiwidmlzaXRvcl9pZCI6IjYwMjgwOTE2OTA5OTA2NTU4NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8327695772783511245be5c2348a48f0fa9f99c1c39a5a27304ce1a0b32f5e47
hovercard-subject-tagissue:3882885479
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/simstudioai/sim/3109/issue_layout
twitter:imagehttps://opengraph.githubassets.com/afb6a5d4e88b0cea777880ae7ed3d7646dd6dd0057f4fcdbf88873ff044cd161/simstudioai/sim/issues/3109
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/afb6a5d4e88b0cea777880ae7ed3d7646dd6dd0057f4fcdbf88873ff044cd161/simstudioai/sim/issues/3109
og:image:altDescription When an API block sends a request with Content-Type: application/x-www-form-urlencoded header and the body contains nested objects or arrays, the values are silently corrupted to the li...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamePlaneInABottle
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
turbo-cache-controlno-preview
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
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
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/simstudioai/sim/issues/3109#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fissues%2F3109
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%2Fsimstudioai%2Fsim%2Fissues%2F3109
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=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/issues/3109
Reloadhttps://github.com/simstudioai/sim/issues/3109
Reloadhttps://github.com/simstudioai/sim/issues/3109
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
https://github.com/simstudioai/sim
New issuehttps://github.com/login?return_to=https://github.com/simstudioai/sim/issues/3109
New issuehttps://github.com/login?return_to=https://github.com/simstudioai/sim/issues/3109
Bug: URLSearchParams silently corrupts object values to [object Object]https://github.com/simstudioai/sim/issues/3109#top
https://github.com/PlaneInABottle
PlaneInABottlehttps://github.com/PlaneInABottle
on Feb 1, 2026https://github.com/simstudioai/sim/issues/3109#issue-3882885479
icecrasher321https://github.com/icecrasher321
completedhttps://github.com/simstudioai/sim/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 14, 2026https://github.com/simstudioai/sim/issues/3109#event-23575413631
Sign up for freehttps://github.com/signup?return_to=https://github.com/simstudioai/sim/issues/3109
Sign in to commenthttps://github.com/login?return_to=https://github.com/simstudioai/sim/issues/3109
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

Viewport: width=device-width


URLs of crawlers that visited me.