File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 54
54
this . initialTimeout = options && options . initialTimeout || 500 ; // 500ms
55
55
this . maxTimeout = options && options . maxTimeout || 5 * 60 * 1000 ; // 5 minutes
56
56
this . reconnectIfNotNormalClose = options && options . reconnectIfNotNormalClose || false ;
57
+ this . binaryType = options && options . binaryType || 'blob' ;
57
58
58
59
this . _reconnectAttempts = 0 ;
59
60
this . sendQueue = [ ] ;
113
114
this . socket . onopen = angular . bind ( this , this . _onOpenHandler ) ;
114
115
this . socket . onerror = angular . bind ( this , this . _onErrorHandler ) ;
115
116
this . socket . onclose = angular . bind ( this , this . _onCloseHandler ) ;
117
+ this . socket . binaryType = this . binaryType ;
116
118
}
117
119
} ;
118
120
121
123
var data = this . sendQueue . shift ( ) ;
122
124
123
125
this . socket . send (
124
- isString ( data . message ) ? data . message : JSON . stringify ( data . message )
126
+ isString ( data . message ) || this . binaryType != "blob" ? data . message : JSON . stringify ( data . message )
125
127
) ;
126
128
data . deferred . resolve ( ) ;
127
129
}
Original file line number Diff line number Diff line change 54
54
this . initialTimeout = options && options . initialTimeout || 500 ; // 500ms
55
55
this . maxTimeout = options && options . maxTimeout || 5 * 60 * 1000 ; // 5 minutes
56
56
this . reconnectIfNotNormalClose = options && options . reconnectIfNotNormalClose || false ;
57
+ this . binaryType = options && options . binaryType || 'blob' ;
57
58
58
59
this . _reconnectAttempts = 0 ;
59
60
this . sendQueue = [ ] ;
113
114
this . socket . onopen = angular . bind ( this , this . _onOpenHandler ) ;
114
115
this . socket . onerror = angular . bind ( this , this . _onErrorHandler ) ;
115
116
this . socket . onclose = angular . bind ( this , this . _onCloseHandler ) ;
117
+ this . socket . binaryType = this . binaryType ;
116
118
}
117
119
} ;
118
120
121
123
var data = this . sendQueue . shift ( ) ;
122
124
123
125
this . socket . send (
124
- isString ( data . message ) ? data . message : JSON . stringify ( data . message )
126
+ isString ( data . message ) || this . binaryType != "blob" ? data . message : JSON . stringify ( data . message )
125
127
) ;
126
128
data . deferred . resolve ( ) ;
127
129
}
You can’t perform that action at this time.
0 commit comments