Skip to content

fixed few bugs pointed by copilot - #2

Merged
Akshad135 merged 1 commit into
mainfrom
burn-pastes
Jul 18, 2026
Merged

Akshad135 merged 1 commit into
mainfrom
burn-pastes

Conversation

@Akshad135

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 18, 2026 06:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens a few edge cases across the frontend and backend: it makes “view raw” rendering safer, fixes how burn rules are serialized when creating a paste, and adjusts the server’s CORS fallback behavior when ALLOWED_ORIGINS is misconfigured.

Changes:

  • ViewPaste: replace document.write(...) with DOM node creation and textContent for raw paste viewing.
  • NewPaste: serialize burn_trigger as 'time' or null (instead of relying on a type cast).
  • main.rs: on invalid ALLOWED_ORIGINS, fall back to restrictive CORS instead of open CORS; remove a one-off frontend fix script.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/pages/ViewPaste.tsx Avoids document.write and uses textContent to render raw paste content safely in a new tab.
src/pages/NewPaste.tsx Ensures burn trigger payload is explicitly 'time' or null for new pastes.
src-rust/main.rs Changes invalid-origin fallback from open CORS to restrictive (no allowed origins), improving security posture.
fix_frontend.py Removes a one-off migration script from the repo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Akshad135
Akshad135 merged commit 05b844a into main Jul 18, 2026
1 of 2 checks passed
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.

2 participants