mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-04 04:02:25 -06:00 
			
		
		
		
	[chore] update go dependencies (#4304)
- github.com/KimMachineGun/automemlimit v0.7.2 => v0.7.3
- github.com/gin-contrib/cors v1.7.5 => v1.7.6
- github.com/minio/minio-go/v7 v7.0.92 => v7.0.94
- github.com/spf13/cast v1.8.0 => v1.9.2
- github.com/uptrace/bun{,/*} v1.2.11 => v1.2.14
- golang.org/x/image v0.27.0 => v0.28.0
- golang.org/x/net v0.40.0 => v0.41.0
- code.superseriousbusiness.org/go-swagger v0.31.0-gts-go1.23-fix => v0.32.3-gts-go1.23-fix
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4304
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
	
	
This commit is contained in:
		
					parent
					
						
							
								7712885038
							
						
					
				
			
			
				commit
				
					
						8b0ea56027
					
				
			
		
					 294 changed files with 139999 additions and 21873 deletions
				
			
		
							
								
								
									
										13
									
								
								vendor/github.com/gin-contrib/sse/sse-decoder.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								vendor/github.com/gin-contrib/sse/sse-decoder.go
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -7,7 +7,6 @@ package sse
 | 
			
		|||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"io"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type decoder struct {
 | 
			
		||||
| 
						 | 
				
			
			@ -22,7 +21,8 @@ func Decode(r io.Reader) ([]Event, error) {
 | 
			
		|||
func (d *decoder) dispatchEvent(event Event, data string) {
 | 
			
		||||
	dataLength := len(data)
 | 
			
		||||
	if dataLength > 0 {
 | 
			
		||||
		//If the data buffer's last character is a U+000A LINE FEED (LF) character, then remove the last character from the data buffer.
 | 
			
		||||
		// If the data buffer's last character is a U+000A LINE FEED (LF) character,
 | 
			
		||||
		// then remove the last character from the data buffer.
 | 
			
		||||
		data = data[:dataLength-1]
 | 
			
		||||
		dataLength--
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -37,13 +37,13 @@ func (d *decoder) dispatchEvent(event Event, data string) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
func (d *decoder) decode(r io.Reader) ([]Event, error) {
 | 
			
		||||
	buf, err := ioutil.ReadAll(r)
 | 
			
		||||
	buf, err := io.ReadAll(r)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var currentEvent Event
 | 
			
		||||
	var dataBuffer *bytes.Buffer = new(bytes.Buffer)
 | 
			
		||||
	dataBuffer := new(bytes.Buffer)
 | 
			
		||||
	// TODO (and unit tests)
 | 
			
		||||
	// Lines must be separated by either a U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair,
 | 
			
		||||
	// a single U+000A LINE FEED (LF) character,
 | 
			
		||||
| 
						 | 
				
			
			@ -96,7 +96,8 @@ func (d *decoder) decode(r io.Reader) ([]Event, error) {
 | 
			
		|||
			currentEvent.Id = string(value)
 | 
			
		||||
		case "retry":
 | 
			
		||||
			// If the field value consists of only characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9),
 | 
			
		||||
			// then interpret the field value as an integer in base ten, and set the event stream's reconnection time to that integer.
 | 
			
		||||
			// then interpret the field value as an integer in base ten, and set the event stream's
 | 
			
		||||
			// reconnection time to that integer.
 | 
			
		||||
			// Otherwise, ignore the field.
 | 
			
		||||
			currentEvent.Id = string(value)
 | 
			
		||||
		case "data":
 | 
			
		||||
| 
						 | 
				
			
			@ -105,7 +106,7 @@ func (d *decoder) decode(r io.Reader) ([]Event, error) {
 | 
			
		|||
			// then append a single U+000A LINE FEED (LF) character to the data buffer.
 | 
			
		||||
			dataBuffer.WriteString("\n")
 | 
			
		||||
		default:
 | 
			
		||||
			//Otherwise. The field is ignored.
 | 
			
		||||
			// Otherwise. The field is ignored.
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue