carefree0910 / carefree-creator

AI magics meet Infinite draw board.
https://creator.nolibox.com/guest
MIT License
2.13k stars 216 forks source link

POSTing to configured local server fails if URL ends with a trailing slash (`/`) #7

Closed anoadragon453 closed 1 year ago

anoadragon453 commented 1 year ago

Following the instructions of the Google Colab, I generated an ngrok URL that looks like https://f24d-68-121-167-240.ngrok.io. Copy-pasting this in Firefox from the Google Colab helpfully formatted it as https://f24d-68-121-167-240.ngrok.io/ (note the trailing slash).

Putting this into the "Use Local Server" field and clicking "Generate Image" results in a POST request from the browser to https://f24d-68-121-167-240.ngrok.io//get_prompt from the browser (note the double forward slashes). The hosted server returns a 404 for this request and the WebUI displays errors:

image

I suggest that either the WebUI strip trailing slashes from configured Local Server URLs, or the server be able to handle multiple, continuous slashes in a request URL.

carefree0910 commented 1 year ago

Oops, good catch! I'll definitely strip trailing slashes for you in the WebUI!

I'll notify you once I finished the modification 😉

carefree0910 commented 1 year ago

@anoadragon453 I think I fixed it; can you refresh the page and try again? 😆

anoadragon453 commented 1 year ago

I can confirm that it works! Thanks for the swift fix :)