Skip to content

Add multipart/form-data support to reverse proxy for binary Grasshopper files#836

Open
TheVessen wants to merge 5 commits intomcneel:9.xfrom
VektorNode:9.x.reverseProxy
Open

Add multipart/form-data support to reverse proxy for binary Grasshopper files#836
TheVessen wants to merge 5 commits intomcneel:9.xfrom
VektorNode:9.x.reverseProxy

Conversation

@TheVessen
Copy link
Copy Markdown

@TheVessen TheVessen commented Mar 18, 2026

Summary

  • Add support for multipart/form-data POST requests in the reverse proxy,
    enabling binary Grasshopper (.gh) files to be sent to rhino.compute for analysis
  • Fix typo in content type ("applicaton/json""application/json")

Motivation

The reverse proxy previously only handled JSON POST bodies by reading them as
strings over IIS. When sending binary Grasshopper files via multipart/form-data, the
content was corrupted because it was forced through string encoding.

The proxy now detects multipart requests and streams the body directly to the
compute child process, preserving binary content integrity.

Test

  • Verify sending a binary .gh file as multipart/form-data is forwarded correctly

TheVessen and others added 5 commits March 18, 2026 19:12
…y reading

- Add multipart/form-data handling in SendProxyRequest, streaming body
  directly without buffering in memory
- Fix synchronous ReadToEnd() replaced with async ReadToEndAsync()
- Fix missing return for JSON POST path (was falling through to NotSupportedException)
- Wrap HttpRequestMessage in using for proper disposal
- Remove StringContent using block that was disposing content before SendAsync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant