dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.16k stars 794 forks source link

Stripping trailing slashes breaks django admin #1744

Open rnovacek opened 8 months ago

rnovacek commented 8 months ago

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

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

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