Base URLs with a trailing slash cause errors
I just set up Commento with Docker on my own server with an Nginx reverse proxy and had some weird issues where clicking the "Sign Up" button on the registration page would disable it and cause nothing to happen. I checked the network log in Firefox and the server had returned an HTTP 405: Method Not Allowed. Same happened if I tried to log in.
Checking the Nginx access logs showed that Commento was trying to access the URL //api/owner/login
, which is not valid. I realized this was because I had set the Commento base URL to https://comments.example.com/
in docker-compose.yml
. After removing the trailing slash, things started working again.
I think Commento should check if the base URL has a trailing slash and store a version without the slash for generating URLs. That or show a useful error to the site admin and exit.