Comments (5)
Hmm, I've never seen that and I'm not quite sure how you'd get there. Are you overriding RequestHandler._execute somehow?
from tornado.
What you've written is unnecessarily complicated and, not to mention, results in error.
Instead of patching RequestHandler._execute
method, you should instead perform the authentication checks in the RequestHandler.prepare
method of the base class.
from tornado.
Hi,
Thank you for comment, the codes are not solid I know that, I am new in the project, I wanna figure out the issue, can you refactor any part for me?
from tornado.
On the file provided by @dryalcinmehmet, there is an options method decorated with tornado.gen.coroutine
, no yields just returns. Should that the be source of the _NullFuture
?
from tornado.
there is an options method decorated with tornado.gen.coroutine, no yields just returns. Should that the be source of the _NullFuture?
No, tornado.gen.coroutine should still use a real future in this case.
I don't see exactly where the _NullFuture is coming from, but this interceptor decorator is problematic in a number of ways. Wrapping _execute without actually calling the underlying _execute method is probably going to break something, as is discarding the return value of the real _execute method.
I agree with @bhch that you should not be overriding _execute
here and should do your auth checks in prepare()
instead. We previously kinda-supported overriding _execute
because prepare
couldn't be asynchronous, but now that we support coroutines in prepare
there's no reason to override _execute
any more and you should stay away from it.
from tornado.
Related Issues (20)
- Can I write a single decorator combining @tornado.gen.coroutine and @run_on_executor. HOT 2
- Possible leak when exception is raised in inner coroutine HOT 1
- iostream: SSL logging is too noisy
- Tornado was blocked for more than 1 second in HOT 1
- static_url with a prefix does not work in a Template tag HOT 2
- how to handle the http stream data without using callback but based on coroutine? HOT 1
- Test fail with openssl 3.2 HOT 1
- tornado.websocket.WebSocketClosedError HOT 1
- Send 204 as HTTPError
- Tornado Websocket write message performance degradation when binary is False HOT 2
- `Subprocess.wait_for_exit` never resolves if process terminated before it is called HOT 3
- Websocket Client Handshake URI issue HOT 1
- Questions about Copilot + Open Source Software Hierarchy
- tornado.httputil.HTTPServerRequest and tornado.web.RequestHandler HOT 1
- Please update to 3.11 HOT 1
- TypeError: WebSocketHandler.init() missing 2 required positional arguments: 'application' and 'request' HOT 1
- Under pytest 8.2.0, 'AsyncHTTPTestCase' has no attribute 'runTest' HOT 1
- 6.4.1: pytest fails in multiple nits with `AttributeError: 'TestIOStreamMixin' object has no attribute 'io_loop'` error HOT 2
- Vulnerability: GHSA-753j-mpmx-qq6g HOT 1
- v6.1,CPU increased to 100% when the client closes the connection HOT 4
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 tornado.