-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for multiple slash #259
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this! This now correctly follows and shows the 400 error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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