Closed mrazo-tamr closed 5 years ago
@mrazo-tamr , you may need a leading AND trailing slash on your base_path
. E.g. base_path = '/api/'
.
@nbateshaus should we add a BREAKING CHANGES
entry to 0.3.0 where the "accepts absolute paths as relative to origin" change was made?
Additionally, if it never makes sense to set a base_path
without a leading/trailing /
, we should either:
base_path
for leading/trailing /
and fails if it doesn'tbase_path
s without leading/trailing /
from the user, but immediately change it to correctly have leading/trailing /
when setting it as a property of the client.I think #2 would be good, even though it would be another breaking change.
🐛 bug report
When using a the
Client.post
method for a custom api endpoint, the Client'sbase_api
attribute does not seem to be used in creating the final url. This results in an incorrect address for the endpoint.🤔 Expected Behavior
A
Client
withbase_url
defined as, for example "api" should only produce requests of the form<host>:<port>/api/<endpoint>
.😯 Current Behavior
The request is pointing to a url with no base_path, i.e. `:/"
Example error:
💁 Possible Solution
Most likely the prepend is simply missing from the code.
Can be worked around by using the absolute path for all
post
requests, but this might cause an error once a fix is released.🔦 Context
Hitting several custom endpoints, both on Unify and multiple husks. 2 of the endpoints (dataset truncate and dataset profile) are now in the versioned API in newer Unify versions, so this issue would not be critical after upgrading.
💻 Code Sample
🌍 Your Environment
RHEL 7 using Anaconda virtual environment