Bloodysunset opened a new issue, #29934:
URL: https://github.com/apache/superset/issues/29934
### Bug description
I've tried to implement a login workflow with the REST API and I encountered
some difficulties with the endpoints ending with a trailing `/`.
### A bit of context
The first endpoint is `/api/v1/security/login`. But for some reason, I added
a `/` at the end (it looked like `/api/v1/security/login/`) and when I tried
the query, it promptly responded with :
```json
{
"errors": [
{
"message": "404 Not Found: The requested URL was not found on
the server. If you entered the URL manually please check your spelling and try
again.",
"error_type": "GENERIC_BACKEND_ERROR",
"level": "error",
"extra": {
"issue_codes": [
{
"code": 1011,
"message": "Issue 1011 - Superset encountered an
unexpected error."
}
]
}
}
]
}
```
Okay, this is a problem I agree with 100%... It's my fault and the API
interrupts the request, telling me I've probably misspelled the URL.
By deleting the unnecessary `/`, I get my access_token; all's well.
### The issue
Assuming the `/` was a problem, I quickly removed it from the other two
endpoints (`/api/v1/security/csrf_token/` & `/api/v1/security/guest_token/`).
Then I tried to request these endpoints and got a timeout (from my backend
which is configured to TO after 10s).
Seeing as the first endpoint **TELLS** me that I've made a mistake, it
didn't occured to me that it could be a spelling issue...
No timeout from Superset, no error, nothing...
So I think my issue is more of an open question than a real problem: **why
do the second and third endpoints end in `/` and why do they behave differently
from the first?**
Thank you for reading through this and I hope you have a wonderful day.
### How to reproduce the bug
### Correct way to handle spelling issue of endpoint
1. take the `/api/v1/security/login` endpoint and add a trailing `/`
2. send the request
3. get a wonderful error response
### Wrong way
1. take either `/api/v1/security/csrf_token/` or
`/api/v1/security/guest_token/` and remove the trailing `/`
2. send the request
3. grow old with your grand-kids waiting for a response
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [ ] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]