serverless-offline icon indicating copy to clipboard operation
serverless-offline copied to clipboard

Stripping trailing slashes breaks django admin

Open rnovacek opened this issue 1 year ago • 0 comments

Bug Report

Current Behavior

serverless-offline strips trailing slashes from URL, so accessing http://localhost:8000/admin/ in the browser translates into http://localhost:8000/admin for the backend that is running with serverless-offline.

Expected behavior/code

URLs ending with slash should have the slash on backend and URLs without shouldn't have. In other words, serverless-offline shouldn't add or remove trailing slash. Or at least there should be an option for this behaviour.

Environment

  • serverless version: 3.2.0
  • serverless-offline version: 13.3.0
  • node.js version: v20.9.0
  • OS: Fedora 39

optional, if you are using any of the following frameworks to invoke handlers

  • python version: v3.9.18
  • django version: 4.2

Possible Solution

Add an option for this.

Additional context/Screenshots

There was noStripTrailingSlashInUrl in older versions of serverless-offline but it got removed. I have no idea what was the reason: https://github.com/dherault/serverless-offline/commit/71ee21db253f601f5355377e1a67d641fc447bea

rnovacek avatar Nov 24 '23 18:11 rnovacek