sdk-go icon indicating copy to clipboard operation
sdk-go copied to clipboard

OptionsHandlerFn is set to DeleteHandlerFn in WithDefaultOptionsHandlerFunc

Open abhradeepkundu opened this issue 3 years ago • 2 comments

https://github.com/cloudevents/sdk-go/blob/1170e89edb9b504a806f2c6a26563c3c26b68276/v2/protocol/http/options.go#L251

Can you please explain why OptionsHandlerFn is set to DeleteHandlerFn in WithDefaultOptionsHandlerFunc

Thanks in advance

abhradeepkundu avatar Nov 17 '21 08:11 abhradeepkundu

It is a bug! ack!!

Want to fix?

n3wscott avatar Nov 17 '21 16:11 n3wscott

Want to fix? Yes definitely.

But in our code we did set it after I receive the protocol object which solves the problem indirectly.... e.g, p, err := cloudevents.NewHTTP( cloudevents.WithDefaultOptionsHandlerFunc([]string{"POST", "OPTIONS"}, 100, []string{"*"}, true)) p.OptionsHandlerFn = p.OptionsHandler

abhradeepkundu avatar Nov 18 '21 03:11 abhradeepkundu