TheSpaghettiDetective / moonraker-obico

GNU Affero General Public License v3.0
147 stars 40 forks source link

server url should trim trailing slash if provided #69

Closed jamincollins closed 1 year ago

jamincollins commented 1 year ago

IME, it isn't uncommon for users (myself included) to supply a trailing slash on the host URL. However, it seems that with this plugin (or more specifically the obico server) a request that includes a double slash results in a 404.

I believe the plugin should trim the trailing slash if present to work around the issue.

Original attempt to verify (with debug output):

## DEBUG: Verifying code "939170" at server URL: "http://obico:3334//api/v1/octo/verify/"
## DEBUG: Server response code "<Response [404]>"

After removing the trailing slash on the URL:

## DEBUG: Verifying code "939170" at server URL: "http://obico:3334/api/v1/octo/verify/"
## DEBUG: Server response code "<Response [200]>"
kennethjiang commented 1 year ago

Good catch @jamincollins Closed in https://github.com/TheSpaghettiDetective/moonraker-obico/commit/67a5218661dceb0bb5b7580b3d33702597ec4ad4