Skip to content
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

PloverDB returning 308 status code when /query is called on the API #51

Open
saramsey opened this issue Sep 13, 2023 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@saramsey
Copy link
Member

See RTXteam/RTX issue 2128

I suspect this is because of the trailing slash in this decorator:

@app.route('/query/', methods=['POST'])

@saramsey saramsey added the bug Something isn't working label Sep 13, 2023
saramsey added a commit that referenced this issue Sep 13, 2023
@saramsey
Copy link
Member Author

New code version has been deployed to kg2cploverdb.ci.transltr.io:

curl  -X GET -H 'accept: application/json' https://kg2cploverdb.ci.transltr.io/code_version
"HEAD: HEAD; Date: 2023-09-13"

All PloverDB pytest tests passed:

pytest -v test/test.py --endpoint https://kg2cploverdb.ci.transltr.io
...
================== 32 passed in 29.84s ==============

The new version no longer returns a 308 status code:

curl -s -X POST -H 'content-type: application/json' -H 'accept: application/json' https://kg2cploverdb.ci.transltr.io/query -d @foo.json -o /dev/null

and note, this does not work on the production PloverDB:

curl -s -X POST -H 'content-type: application/json' -H 'accept: application/json' https://kg2cploverdb.transltr.io/query -d @foo.json
<!doctype html>
<html lang=en>
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to the target URL: <a href="https://kg2cploverdb.transltr.io/query/">https://kg2cploverdb.transltr.io/query/</a>. If not, click the link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants