File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 5454 this . initialTimeout = options && options . initialTimeout || 500 ; // 500ms
5555 this . maxTimeout = options && options . maxTimeout || 5 * 60 * 1000 ; // 5 minutes
5656 this . reconnectIfNotNormalClose = options && options . reconnectIfNotNormalClose || false ;
57+ this . binaryType = options && options . binaryType || 'blob' ;
5758
5859 this . _reconnectAttempts = 0 ;
5960 this . sendQueue = [ ] ;
113114 this . socket . onopen = angular . bind ( this , this . _onOpenHandler ) ;
114115 this . socket . onerror = angular . bind ( this , this . _onErrorHandler ) ;
115116 this . socket . onclose = angular . bind ( this , this . _onCloseHandler ) ;
117+ this . socket . binaryType = this . binaryType ;
116118 }
117119 } ;
118120
121123 var data = this . sendQueue . shift ( ) ;
122124
123125 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 )
125127 ) ;
126128 data . deferred . resolve ( ) ;
127129 }
Original file line number Diff line number Diff line change 5454 this . initialTimeout = options && options . initialTimeout || 500 ; // 500ms
5555 this . maxTimeout = options && options . maxTimeout || 5 * 60 * 1000 ; // 5 minutes
5656 this . reconnectIfNotNormalClose = options && options . reconnectIfNotNormalClose || false ;
57+ this . binaryType = options && options . binaryType || 'blob' ;
5758
5859 this . _reconnectAttempts = 0 ;
5960 this . sendQueue = [ ] ;
113114 this . socket . onopen = angular . bind ( this , this . _onOpenHandler ) ;
114115 this . socket . onerror = angular . bind ( this , this . _onErrorHandler ) ;
115116 this . socket . onclose = angular . bind ( this , this . _onCloseHandler ) ;
117+ this . socket . binaryType = this . binaryType ;
116118 }
117119 } ;
118120
121123 var data = this . sendQueue . shift ( ) ;
122124
123125 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 )
125127 ) ;
126128 data . deferred . resolve ( ) ;
127129 }
You can’t perform that action at this time.
0 commit comments