Skip to content

Fix: Video upload from the device is fixed in browser#337

Merged
Dharp02 merged 2 commits into
mainfrom
bug-pulse-upload-causing-issues
Jun 11, 2026
Merged

Fix: Video upload from the device is fixed in browser#337
Dharp02 merged 2 commits into
mainfrom
bug-pulse-upload-causing-issues

Conversation

@Dharp02

@Dharp02 Dharp02 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Here's a concise summary you can use for updates, standups, or PR notes:

PulseVault Video Upload Fix Summary

Resolved a video upload issue caused by Mixed Content errors during TUS uploads. While the /v1/video/reserve endpoint was already returning HTTPS URLs, the underlying TUS server (@tus/server via srvx) was still generating Location headers with HTTP URLs, causing browsers to block uploads when accessed from the HTTPS frontend.

Changes Implemented

  • Enabled trustProxy: true in server.ts so Fastify correctly respects x-forwarded-proto headers and detects HTTPS requests behind the proxy.
  • Added a rewriteRawLocationHeader pre-handler in pulsevault.ts for both PulseVault route scopes.
  • Intercepted both reply.raw.setHeader() and reply.raw.writeHead() responses to rewrite any Location: http://... headers to https://... whenever requests originate from an HTTPS frontend.
  • Rebuilt the application and restarted the correct production PM2 process (timehuddle-api) running under the root account.

Verification

  • Successfully tested video uploads from the HTTPS frontend (https://timehuddledev.os.mieweb.org).
  • Verified both Media Library uploads and Ticket Attachment uploads.
  • TUS upload creation returned HTTPS Location headers.
  • Upload PATCH requests completed successfully (204 Upload-Offset responses).
  • Media items and ticket attachments were correctly persisted in the database.
  • Mixed Content errors no longer occur, and video uploads now work end-to-end over HTTPS.

@Dharp02 Dharp02 self-assigned this Jun 11, 2026
@Dharp02 Dharp02 linked an issue Jun 11, 2026 that may be closed by this pull request
@Dharp02 Dharp02 merged commit 911f52f into main Jun 11, 2026
3 of 4 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in Scrum Team Jerry Jun 11, 2026
@Dharp02 Dharp02 deleted the bug-pulse-upload-causing-issues branch June 18, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bug: Pulse upload causing issues

1 participant