soap icon indicating copy to clipboard operation
soap copied to clipboard

Provide extra callbacks for cowboy protocol 1,2

Open define-null opened this issue 8 years ago • 12 comments

The main motivation of this pullrequest is as following:

If one is using cowboy middleware for example to do the logging of the http body - then the body will be no longer available through cowboy_req:body/2 call. This pullrequest allows to provide Body by using soap_cowboy_1_protocol:upgrade/5 or soap_cowboy_2_protocol:upgrade/7. In this case extra tiny module will be needed from the user's side to read body from whether he stored it, and provide it down to the soap library.

For example in our case middleware that does the logging stores body with cowboy_req:meta/2.

define-null avatar Jan 11 '17 16:01 define-null

@cmullaparthi What do you think?)

define-null avatar Jan 12 '17 12:01 define-null

I've had a quick look and it looks good. I want to look a bit deeper before I merge it - will get it done soon. Thanks for the contribution.

cmullaparthi avatar Jan 12 '17 16:01 cmullaparthi

@cmullaparthi ping me if you want me to provide some tests regarding those callbacks.

define-null avatar Jan 17 '17 15:01 define-null

@define-null this looks good to me, but it would be great to have some tests validating this. Could you please provide some?

cmullaparthi avatar Jan 17 '17 21:01 cmullaparthi

@cmullaparthi Provided tests for the this functionality. Tests on 1.1.x cowboy branch pass fine.

BTW Current cowboy2 integration seems to be broken. At least api that I checked here https://github.com/ninenines/cowboy/blob/2.0.0-pre.5/src/cowboy.erl differs from what soap expect it to be.

And thank you for the library!

define-null avatar Jan 18 '17 14:01 define-null

Oh I see, it was broken since https://github.com/ninenines/cowboy/blob/2.0.0-pre.4/src/cowboy.erl

define-null avatar Jan 18 '17 15:01 define-null

Ping :)

define-null avatar Jan 21 '17 12:01 define-null

@cmullaparthi would be nice to see your comments on this

define-null avatar Feb 03 '17 09:02 define-null

Any updates? We may drop this functionality for cowboy 2.0 for now, untill 2.0.0 final goes live

define-null avatar Feb 21 '17 11:02 define-null

@willemd ping

define-null avatar Feb 27 '17 18:02 define-null

So the cowboy 2.0 is already there @cmullaparthi @willemdj are you gonna consider this pullrequest if I will introduce all the necessary changes?

define-null avatar Dec 07 '17 10:12 define-null

I fixed support for cowboy 2. Tested on both cowboy 2.2.2 and cowboy 1.1.2

define-null avatar Mar 28 '18 14:03 define-null