John Gedik
John Gedik

Reputation: 1

spyne with DispatcherMiddleware modifying request header

My application is getting messages from different clients and sending information to different flask and spyne servers. In some cases method in ctx.method_request_string is different than the method in the request header and we use DispatcherMiddleware to pass information, since ctx.method_request_string is always right, I would like to pass this information to DispatcherMiddleware but I was not able to do it w/o parsing the envelope which I would like to avoid.

How can I update the request header or pass information to DispatcherMiddleware some other way?

Upvotes: -1

Views: 147

Answers (1)

John Gedik
John Gedik

Reputation: 1

After research, I concluded that there is no way to access ctx.method_request_string from within DispatcherMiddleware as it is not created at the time of the call to the dispatcher.

In fact, my app is like: https://github.com/arskom/spyne/tree/master/examples/flask

The only difference, I subclassed the DispatcherMiddleware and I access the request headers inside call. It looks like I have to parse soap envelop again to get the method request string as ctx.method_request_string is not available at the time o.

Upvotes: 0

Related Questions