You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Discovered an undocumented API /api/search_endpoints/<search_endpoint_id> but making a PUT request with the same data from the GET response (just modifying some field values) doesn't update the search_endpoint. Receives a 204 and no changes when looking at the endpoint in the UI. Specifically interested in making updates to the custom_headers field.
To Reproduce
Steps to reproduce the behavior:
Make a GET request to /api/search_endpoints to retrieve search endpoints
Use the search_endpoint_id from the response to make a GET request to /api/search_endpoints/<search_endpoint_id>
Using the response, modify the custom_headers field
Make a PUT request to /api/search_endpoints/<search_endpoint_id> with the updated data
Receive a response code 204 and no updates visible in the UI
Expected behavior
Should be able to update the search endpoint's custom headers
Additional context
Here are some json payload examples that have been tried: { "name": "Name", "search_endpoint_id": 1234, "endpoint_url": "https://example.com/search", "search_engine": "searchapi", "api_method": "GET", "custom_headers": {"Custom-Flag": "foobar", "Authorization": "Bearer foo"}, "basic_auth_credential": "", "mapper_code": "...", "proxy_requests": true }
and { "search_endpoint": { "name": "Name", "search_endpoint_id": 1234, "endpoint_url": "https://example.com/search", "search_engine": "searchapi", "api_method": "GET", "custom_headers": {"Custom-Flag": "foobar", "Authorization": "Bearer foo"}, "basic_auth_credential": "", "mapper_code": "...", "proxy_requests": true } }
I've also tried the form data below (similar to what happens in the UI): search_endpoint[custom_headers]: ""{\"Custom-Flag\": \"foobar\", \"Authorization\": "Bearer foo\"}"" _method: "patch" authenticity_token: "1234asdf" commit: "Update Search endpoint"
The text was updated successfully, but these errors were encountered:
Describe the bug
Discovered an undocumented API
/api/search_endpoints/<search_endpoint_id>
but making a PUT request with the same data from the GET response (just modifying some field values) doesn't update the search_endpoint. Receives a 204 and no changes when looking at the endpoint in the UI. Specifically interested in making updates to thecustom_headers
field.To Reproduce
Steps to reproduce the behavior:
/api/search_endpoints
to retrieve search endpointssearch_endpoint_id
from the response to make a GET request to/api/search_endpoints/<search_endpoint_id>
custom_headers
field/api/search_endpoints/<search_endpoint_id>
with the updated dataExpected behavior
Should be able to update the search endpoint's custom headers
Additional context
Here are some json payload examples that have been tried:
{ "name": "Name", "search_endpoint_id": 1234, "endpoint_url": "https://example.com/search", "search_engine": "searchapi", "api_method": "GET", "custom_headers": {"Custom-Flag": "foobar", "Authorization": "Bearer foo"}, "basic_auth_credential": "", "mapper_code": "...", "proxy_requests": true }
and
{ "search_endpoint": { "name": "Name", "search_endpoint_id": 1234, "endpoint_url": "https://example.com/search", "search_engine": "searchapi", "api_method": "GET", "custom_headers": {"Custom-Flag": "foobar", "Authorization": "Bearer foo"}, "basic_auth_credential": "", "mapper_code": "...", "proxy_requests": true } }
I've also tried the form data below (similar to what happens in the UI):
search_endpoint[custom_headers]: ""{\"Custom-Flag\": \"foobar\", \"Authorization\": "Bearer foo\"}"" _method: "patch" authenticity_token: "1234asdf" commit: "Update Search endpoint"
The text was updated successfully, but these errors were encountered: