Commit Message Generated by Copilot

Enhance date handling, error checks, data limits, and rate limiting

- Added `using System.Globalization;` to support date and time formatting.
- Handled empty/null paste titles with defaults and truncation.
- Display paste dates as human-readable time differences.
- Changed rate limiting policy to "fixed-bigger".
- Improved error handling for `/api/create` endpoint.
- Updated `ConvertToBytes` method for clarity.
- Added `GetDifference` method for date comparisons.
- Enforced length limits on input fields in `index.html`.
This commit is contained in:
whoswhip
2024-08-19 04:46:58 -04:00
parent 47aed18919
commit 59fe4caa4d
2 changed files with 72 additions and 11 deletions
+2 -2
View File
@@ -17,9 +17,9 @@
<h1>create paste</h1>
<form id="createForm">
<label for="pasteTitle" class="label">Title</label>
<input type="text" id="pasteTitle" class="textinput" name="pasteTitle">
<input type="text" id="pasteTitle" class="textinput" name="pasteTitle" maxlength="500">
<label for="pasteContent" class="label">Content</label>
<textarea id="pasteContent" class="textarea" name="pasteContent" required ></textarea>
<textarea id="pasteContent" class="textarea" name="pasteContent" required maxlength="500000"></textarea>
<button type="submit" class="button">Create</button>
</form>
</div>