Accessing request object in DB_CONNECTION_MUTATOR in 4.1.0 #30982
-
Hi, In 4.0.2 (and earlier) I could access the flask request object in the DB_CONNECTION_MUTATOR, and specifically get the request headers. However, in 4.1.0 the request object's URL seems to be The following is how I determine what the request object looks like from inside DB_CONNECTION_MUTATOR (raising an Exception which then becomes visible in the UI) def DB_CONNECTION_MUTATOR(uri, params, username, security_manager, source):
from flask import request
raise Exception(str(list(request.headers.keys())) + ' ' + request.url) How can I get at the real HTTP headers from inside DB_CONNECTION_MUTATOR? If it makes a difference, I am testing from within SQL Lab |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I've currently got a suspicion that the culprit could be https://github.com/apache/superset/pull/29461/files: it does look a little bit like there's a test context in the mutator |
Beta Was this translation helpful? Give feedback.
Adding this to my superset_config.py seems to fix it: