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
Currently if the front-end makes an API request to the backend, the url needs to be an exact match in order to get a response otherwise it returns a 500 TemplateDoesNotExist exception or a Forbidden (403) error.
I experienced this issue when creating a test endpoint with the url localhost:8000/endpoint and tried making requests to localhost:8000/endpoint/. Similarly, the same error happens when the endpoint url is localhost:8000/endpoint/ and a call to localhost:8000/endpoint is made.
There should be a standard for whether we include a trailing slash or not in the django urls.py files. As an example server/api/views/jira/urls.py has no trailing slashes for any of the endpoints, server/api/views/listMeds/urls.py has trailing slashes, and server/api/views/chatgpt/urls.py has both trailing slashes and no trailing slashes in the urls
There should be a way to automatically redirect a url with or without a trailing slash to the correct endpoint. According to the Django docs, this error shouldn't be present. I'm not entirely sure why it isn't working here.
On the front end, it could be beneficial to create a apiClient.ts file that contains every axios api request and react components can import the necessary functions rather than write them internally. This would help with standardizing api requests from the front-end
I'm also unsure as to why for some incorrect url calls, it returns the 500 TemplateDoesNotExist exception vs. Forbidden (403) error. However the fix should address both of these.
The text was updated successfully, but these errors were encountered:
Currently if the front-end makes an API request to the backend, the url needs to be an exact match in order to get a response otherwise it returns a 500 TemplateDoesNotExist exception or a Forbidden (403) error.
I experienced this issue when creating a test endpoint with the url
localhost:8000/endpoint
and tried making requests tolocalhost:8000/endpoint/
. Similarly, the same error happens when the endpoint url islocalhost:8000/endpoint/
and a call tolocalhost:8000/endpoint
is made.apiClient.ts
file that contains every axios api request and react components can import the necessary functions rather than write them internally. This would help with standardizing api requests from the front-endI'm also unsure as to why for some incorrect url calls, it returns the 500 TemplateDoesNotExist exception vs. Forbidden (403) error. However the fix should address both of these.
The text was updated successfully, but these errors were encountered: