igm / sockjs-go

WebSocket emulation - Go server library
BSD 3-Clause "New" or "Revised" License
514 stars 100 forks source link

Expose the type of receiver against the session #86

Closed dombenson closed 4 years ago

dombenson commented 4 years ago

This is useful for diagnostics or logging when fallback mechanisms are in use

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-1.2%) to 93.29% when pulling ad4c80af4831123f738fbd718845f010921a507e on dombenson:expose-receiver-type into cd6986df5bcc018f38ce4c5e07a2dfa6c268fc64 on igm:master.

FZambia commented 4 years ago

The implementation looks not thread-safe, also I think that for debugging purposes it's enough to just use session.Request().URL.Path

Maybe In general the helper like this could be useful but in my opinion it must also distinguish HTTP fallback type used - i.e. xhr-streaming, eventsource etc.

igm commented 4 years ago

fixed in v3