Skip to content

PWA failed because HTTP basic auth block static assets #12447

@heimoshuiyu

Description

@heimoshuiyu

Description

TLDR: Update the HTTP basic auth middleware to allow static resources through.

Reason: I run OPENCODE_SERVER_PASSWORD=iampassword opencode web to start the web service and configure an HTTPS certificate so I can access it via my phone browser outdoors (PWA requires HTTPS). But the browser wouldn’t recognize it as a PWA app.

After investigating, the issue is that OpenCode’s backend HTTP basic auth middleware at packages/opencode/src/server/server.ts blocks access to /site.webmanifest. After skipping auth for it, the browser correctly recognizes it as a PWA app.

Plugins

none

OpenCode version

dev

Steps to reproduce

  1. OPENCODE_SERVER_PASSWORD=iampassword opencode web
  2. Setup your HTTPS web proxy for it
  3. Navigate to the HTTPS website. Check chromium F12 tool "Application"

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebRelates to opencode on web / desktop

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions