Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Coder applications always strips the subpath, even if the application can be configured to handle it #14483

Labels
need-backendIssues that need backend work
@Emyrk

Description

@Emyrk

When you configure acoder_app that is path based, Coderd will always strip the subpath from the proxied request.

So when you hit

GET /@Emyrk/workspace.main/apps/code-server/

The app sees the request as:

GET /

This happens in the code here:

// Determine the real path that was hit. The * URL parameter in Chi will not
// include the leading slash if it was present, so we need to add it back.
chiPath:=chi.URLParam(r,"*")
basePath:=strings.TrimSuffix(r.URL.Path,chiPath)
ifstrings.HasSuffix(basePath,"/") {
chiPath="/"+chiPath
}

Itstrips the base path from the request, assuming the application behind the proxydoes not want this base path.

However

Many applications like VSCode Web support flags like--server-base-path, which allows hosting an application on a subpath. This is required, because all urls made from the app are absolute.

So today, if you do not configure--server-base-path, the app will fail to load resources, since it constructs urls from"/". And if you configure the base path, our proxy strips that, so you get a404 as you hit/ on the app, where it expects/@Emyrk/workspace.main/apps/code-server/

Solution

We should have an option oncoder_app tonot strip the base path from proxied requests. Some boolean like:url_passthrough to tell the proxy service to not alter the request url in any way.

Some other apps that would require this (off the top of my head)

  • RStudio
  • Jupyter (pretty sure)

Why do this

This will expand support for more path based applications.

Would fix this:coder/modules#288

Metadata

Metadata

Assignees

No one assigned

    Labels

    need-backendIssues that need backend work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp