Skip to content
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

V7, on_request on first access does not work #294

Open
platipusica opened this issue Mar 12, 2024 · 0 comments
Open

V7, on_request on first access does not work #294

platipusica opened this issue Mar 12, 2024 · 0 comments

Comments

@platipusica
Copy link
Collaborator

platipusica commented Mar 12, 2024

Hi,
when App is accessed with /oauth2callback for the FIRST TIME, the on_request responds with 404:

./server.py 5000
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:5000
 * Running on http://172.20.10.5:5000
Press CTRL+C to quit
127.0.0.1 - - [12/Mar/2024 11:16:21] "POST /api HTTP/1.1" 200 -
/oauth2callback
ERROR - 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.
Traceback (most recent call last):
...
11111111 /oauth2callback GET
22222222 ['oauth2callback']
...

The fix is to access first with login.html, and then with oauth2callback. It does not throw 404 after that.

on_request:
def on_request(task, request):
print(11111111, request.path, request.method)
parts = request.path.strip('/').split('/')
print(22222222, parts)

D.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant