Skip to content

Non-obvious double slash causes HTTP 500  #10084

Description

@jernst

Steps:

  1. Install Nextcloud 13.0.2 at https://example.com/nextcloud/
  2. Run Linux Desktop client, enter https://example.com/nextcloud/ (note the trailing slash) as the URL

Observation:

  • Desktop client fails to connect with an error message.
  • Server has an HTTP 500 in the log.
  • caused by this Exception in lib/private/AppFramework/Http/Request.php:
                if (!empty($path)) {
                        if($path === $pathInfo || strpos($pathInfo, $path.'/') === 0) {
                                $pathInfo = substr($pathInfo, strlen($path));
                        } else {
                                throw new \Exception("The requested uri($requestUri) cannot be processed by the script '$scriptName')");
                        }
                }

If works if I do not provide the trailing slash in the URL.

Remedy:
Either client-side, or server-side, be more tolerant. Many users -- like myself -- type trailing slashes when entering URLs in their browser to avoid an extra HTTP round-trip. Alternatively, provide a more meaningful error message, but I'd prefer the more tolerant approach.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions