Explain a too-large share instead of showing "server returned 413" - #623
Merged
Merged
Conversation
nginx on the PlanShare server now allows 10 MB request bodies on /api/, matching Kestrel's MaxRequestBodySize; before, its 1 MB default refused 1-10 MB shares first. Above 10 MB both still refuse the upload, and neither sends a JSON error, so the web client showed "Share failed: server returned 413". It now says the plan is too large to share and names the limit. Server text still wins when a 413 carries one. The Kestrel limit's comment now records the nginx setting, which lives only on the server, so the three places that state 10 MB change together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019tS6P95Dtzs4aeMpb1xqzX
|
Reviewed: no findings. The 413 fallback runs only after the server's JSON |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
client_max_body_size, so its 1 MB default applied, while the app accepts 10 MB. Shares from 1 to 10 MB failed with "Share failed: server returned 413". I addedclient_max_body_size 10m;to the/api/location, rannginx -t, and reloaded.Changes
src/PlanViewer.Web/Services/PlanShareService.cs: a 413 without a JSON error gets the size message. When the server does send error text, that text still wins.server/PlanShare/Program.cs: comment only. It names the nginx setting and the web client's message.tests/PlanViewer.Core.Tests/PlanShareServiceTests.cs:The server change
/root/nginx-backups/stats.erikdarling.com.20260929T193036Z./api/sharegot nginx's 413.nginxandplanshareare both active.Test Plan
PlanShareServiceTests: 15 passed, 0 failed.The
Program.cscomment is underserver/PlanShare/**, so the next release merge redeploys PlanShare with no change in behavior.Generated with Claude Code
https://claude.ai/code/session_019tS6P95Dtzs4aeMpb1xqzX