GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
To use itty-based applications in a wsgi pipeline with another, itty app should have more access to environ dict.
The most important is a 'SCRIPT_NAME' param, because it is used to construct application urls.
For example, I've implemented it in a ruthenium@23ceba7, where I've just added the script_name and user params to request:
self.script_name = self._environ.get('SCRIPT_NAME', '')
self.user = self._environ.get('REMOTE_USER', None)
But maybe the request should have access to the private environ variable using something like 'getenv' or etc?..
I guess I'm confused on this. Couldn't you get the same information elsewhere by doing request._environ.get('SCRIPT_NAME', '')? If you could explain the use case a little better (like in conjunction with what other software does this fall down), that'd help me a lot.
Of course I can do it, but the issue is that the class members starting with _ are supposed to be private in python. Yes, they are accessible from the outside, but I thought it is not a good practice to do so. Anyway, I've created this issue mainly in order to find a better way to access the environ — should it be accessed directly, as you described, or through some helpers, that, as I thought would be more ideologically correct.
Fair enough. That variable wasn't going to change anytime soon but I can understand not feeling comfortable using it. Let me think on it a bit & I'll work up a better way to access things.
OK, thanks for your effort!
Fixed in SHA: c3b716f & released as v0.8.0.