Conversation
|
|
||
| test_completion "http://localhost:8000/openai/v1/completions" | ||
| # Double slash in the URL should work as well. | ||
| test_completion "http://localhost:8000/openai//v1/completions" |
There was a problem hiding this comment.
This fails with 'HTTP code: 301'
You can use a curl param to follow the redirect or just assert the 301 with the correct target
-L, --location
(HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option
makes curl redo the request on the new place. If used together with -i, --include or -I, --head, headers from all requested pages are shown.
There was a problem hiding this comment.
Thanks for catching this! This now correctly follows and shows the 400 error.
There was a problem hiding this comment.
weird, on my local curl I can reproduce 400 error, but seems the automated test does not. See here: #257 (comment)
|
@alpe if you have some ideas on how to fix this, feel free to just take my test and submit a PR. I haven't started looking into how to fix it yet. |
|
👍 The test passes with the |
|
I tried to reproduce in go but it ended up being too much work. I do agree that we should test this kind of thing in a unit test case instead. Note the test case is failing as expected now, so need to figure out how to fix it. |
Fix for #257