Comments (5)
yes that does sound sensible, thank you!
from matrix-registration.
Ok, unfortunately it looks like Flask returns a 400 error when force_json=True
and the request body is empty. This can be overridden by extending the default flask.Request
class object with a custom on_json_loading_failed()
method that returns None
in that particular case. Not sure if this is worth the added complexity, however.
As an alternative we could also specify silent=False
, which would cause get_json()
to return None
any time JSON parsing fails. This seems like a really bad idea to me though because it would result in the server silently substituting default values any time the user supplies invalid JSON, which would be surprising at best and catastrophic at worst (e.g. someone tries to create a one-time use token with a short lifetime and ends up creating an unlimited-use token that lives forever.)
What do you think? Worth customizing the Request
class or no?
from matrix-registration.
actually, wait - BadRequest
is an exception, so we can just catch that and handle it. Let me just make sure that works.
Edit: Ok, looks like it does.
from matrix-registration.
Getting the same error when attempting to list tokens as documented, related?
curl -H "Authorization: SharedSecret verysecuresecret" \
http://localhost:5000/token
from matrix-registration.
Looks like it could be related, does including a Content-Type: application/json
header eliminate the issue?
from matrix-registration.
Related Issues (20)
- docker healthcheck fails after running for a while
- Errors by exec "matrix-registration"
- home_server field in registration response is deprecated HOT 3
- No such option --config-path HOT 3
- Broken with SQLAlchemy 2+
- synapse's password policy is ignored/circumvented HOT 4
- All Requests Respond with 404 After Upgrade HOT 2
- Add Support for deleting tokens from the database via API HOT 1
- Remote IP not captured correctly HOT 9
- Not compatible with flask-limiter >= 2.0.1, but `setup.py` will cause it to be installed anyways HOT 4
- Are you still updating the docker images? HOT 2
- Generated token is not recognized HOT 2
- API does not working? HOT 5
- OSError: [Errno 99] Cannot assign requested address HOT 7
- arm64 docker image HOT 1
- Can't access registration page on port 5000 HOT 8
- install error on Ubuntu 22.04 HOT 2
- How to change Website language? HOT 1
- 404 Error ehwn i try to connect matrix-registration on port 5000 HOT 5
- Is this project dead? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matrix-registration.