Closed horstmannmat closed 10 months ago
there's Options
struct that is passed to NewHandler(...)
func. Would it make sense to add more fields there? e.g. DisableXhr
or DisableEventStream
. It'll be backwards compatible this way
Yeah, I was considering the same thing, but would not be too polluted having one boolean for each method? A array of allowed type maybe? And Len(array) == all types?
I'd probably prefer one boolean for each method, there'll be 5 more Disable*
flags:
DisableXHR
DisableXHRStreaming
DisableEventSource
DisableHtmlFile
DisableJSONP
default is flase
which means it is backwards compatible and simple at the same time.
ATM, there is no way of restricting Methods for socksJS (e.g. If I don't want my application to use XHR)
My idea is to add a bitmask (using the ReceiverType)on the NewHandler function, the default would be all, if not default, then it would be only the types within the bitmask