8000 fix(http): change default endpoints methods to post by hanxiao · Pull Request #2775 · jina-ai/serve · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(http): change default endpoints methods to post #2775

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

Merged
merged 2 commits into from
Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
8000
Diff view
Diff view
1 change: 1 addition & 0 deletions jina/peapods/runtimes/gateway/http/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def expose_executor_endpoint(exec_endpoint, http_path=None, **kwargs):
'response_model',
JinaResponseModel, # use standard response model by default
)
kwargs['methods'] = kwargs.get('methods', ['POST'])

@app.api_route(
path=http_path or exec_endpoint, name=http_path or exec_endpoint, **kwargs
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/flow/test_flow_http_extend.py
4C94
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_flow_expose_endpoints():
r = requests.get(f'http://localhost:{f1.port_expose}/foo')
assert r.status_code == 404

f1.expose_endpoint('/foo', methods=['POST'])
f1.expose_endpoint('/foo')
with f1:
r = requests.post(
f'http://localhost:{f1.port_expose}/foo',
Expand Down
0