-
Notifications
You must be signed in to change notification settings - Fork 89
Python and Ruby runtimes don't expose event.extensions.response #28
Comments
Initially only the I am unaware if that is something we can achieve with Python and Ruby (even though it seems that it should be something possible). We are open to contributions in that front. |
I'm pretty positive about python as it's something you can definitely do with the bottle response-object and sinatry should have similar options. I actually wanted to start on a contribution, but it seems the integration tests or their setup-tooling does not really match reality anymore (looks like they expect the runtimes.jsonnet-file required to build the kubeless.yaml to still be in the kubeless-repo) and I fear I lack the know-how about the two projects to fix that. I'll still look into the changes necessary on kubeless.py tomorrow and maybe someone can help me out with the test-setup. |
I see now why this has not been added before. With the separate memory of the spawned processes, propagating changes to the response-object is not very straight forward. |
Thanks for giving it a try @jmtoball! I am not really a python developer so I have a couple of questions:
def funcWrap(q, event, c, namespace, bottle):
event["extensions"]["response"] = bottle.response
|
Hey! What I don't like is the fact that I have to copy protected ( |
I see, it seems that we'll be likely introducing new bugs for that. My only suggestion here is not to rely on HTTP headers and adding the required information in the response object that we have. |
While the documentation lists it and the PHP, Go and Node runtimes include the response-object in the event extensions, the Python and Ruby runtimes do not. As do the ballerina, Java and .Net-runtimes, but their Handlers seem a bit different anyway, while the Bottle/Sinatra-Request/Response objects could probably be handled similarly to the express ones.
Is this on purpose or an oversight?
My usecase is to add headers to the response, which the nodejs runtime allows via the exposed response object, but the Python and Ruby ones don't. If there is another way to do this, I'd be happy about suggestions.
The text was updated successfully, but these errors were encountered: