mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-04 09:02:25 -06:00 
			
		
		
		
	Grand test fixup (#138)
* start fixing up tests * fix up tests + automate with drone * fiddle with linting * messing about with drone.yml * some more fiddling * hmmm * add cache * add vendor directory * verbose * ci updates * update some little things * update sig
This commit is contained in:
		
					parent
					
						
							
								329a5e8144
							
						
					
				
			
			
				commit
				
					
						98263a7de6
					
				
			
		
					 2677 changed files with 1090869 additions and 219 deletions
				
			
		
							
								
								
									
										102
									
								
								vendor/github.com/gorilla/sessions/lex.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								vendor/github.com/gorilla/sessions/lex.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,102 @@
 | 
			
		|||
// This file contains code adapted from the Go standard library
 | 
			
		||||
// https://github.com/golang/go/blob/39ad0fd0789872f9469167be7fe9578625ff246e/src/net/http/lex.go
 | 
			
		||||
 | 
			
		||||
package sessions
 | 
			
		||||
 | 
			
		||||
import "strings"
 | 
			
		||||
 | 
			
		||||
var isTokenTable = [127]bool{
 | 
			
		||||
	'!':  true,
 | 
			
		||||
	'#':  true,
 | 
			
		||||
	'$':  true,
 | 
			
		||||
	'%':  true,
 | 
			
		||||
	'&':  true,
 | 
			
		||||
	'\'': true,
 | 
			
		||||
	'*':  true,
 | 
			
		||||
	'+':  true,
 | 
			
		||||
	'-':  true,
 | 
			
		||||
	'.':  true,
 | 
			
		||||
	'0':  true,
 | 
			
		||||
	'1':  true,
 | 
			
		||||
	'2':  true,
 | 
			
		||||
	'3':  true,
 | 
			
		||||
	'4':  true,
 | 
			
		||||
	'5':  true,
 | 
			
		||||
	'6':  true,
 | 
			
		||||
	'7':  true,
 | 
			
		||||
	'8':  true,
 | 
			
		||||
	'9':  true,
 | 
			
		||||
	'A':  true,
 | 
			
		||||
	'B':  true,
 | 
			
		||||
	'C':  true,
 | 
			
		||||
	'D':  true,
 | 
			
		||||
	'E':  true,
 | 
			
		||||
	'F':  true,
 | 
			
		||||
	'G':  true,
 | 
			
		||||
	'H':  true,
 | 
			
		||||
	'I':  true,
 | 
			
		||||
	'J':  true,
 | 
			
		||||
	'K':  true,
 | 
			
		||||
	'L':  true,
 | 
			
		||||
	'M':  true,
 | 
			
		||||
	'N':  true,
 | 
			
		||||
	'O':  true,
 | 
			
		||||
	'P':  true,
 | 
			
		||||
	'Q':  true,
 | 
			
		||||
	'R':  true,
 | 
			
		||||
	'S':  true,
 | 
			
		||||
	'T':  true,
 | 
			
		||||
	'U':  true,
 | 
			
		||||
	'W':  true,
 | 
			
		||||
	'V':  true,
 | 
			
		||||
	'X':  true,
 | 
			
		||||
	'Y':  true,
 | 
			
		||||
	'Z':  true,
 | 
			
		||||
	'^':  true,
 | 
			
		||||
	'_':  true,
 | 
			
		||||
	'`':  true,
 | 
			
		||||
	'a':  true,
 | 
			
		||||
	'b':  true,
 | 
			
		||||
	'c':  true,
 | 
			
		||||
	'd':  true,
 | 
			
		||||
	'e':  true,
 | 
			
		||||
	'f':  true,
 | 
			
		||||
	'g':  true,
 | 
			
		||||
	'h':  true,
 | 
			
		||||
	'i':  true,
 | 
			
		||||
	'j':  true,
 | 
			
		||||
	'k':  true,
 | 
			
		||||
	'l':  true,
 | 
			
		||||
	'm':  true,
 | 
			
		||||
	'n':  true,
 | 
			
		||||
	'o':  true,
 | 
			
		||||
	'p':  true,
 | 
			
		||||
	'q':  true,
 | 
			
		||||
	'r':  true,
 | 
			
		||||
	's':  true,
 | 
			
		||||
	't':  true,
 | 
			
		||||
	'u':  true,
 | 
			
		||||
	'v':  true,
 | 
			
		||||
	'w':  true,
 | 
			
		||||
	'x':  true,
 | 
			
		||||
	'y':  true,
 | 
			
		||||
	'z':  true,
 | 
			
		||||
	'|':  true,
 | 
			
		||||
	'~':  true,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func isToken(r rune) bool {
 | 
			
		||||
	i := int(r)
 | 
			
		||||
	return i < len(isTokenTable) && isTokenTable[i]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func isNotToken(r rune) bool {
 | 
			
		||||
	return !isToken(r)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func isCookieNameValid(raw string) bool {
 | 
			
		||||
	if raw == "" {
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
	return strings.IndexFunc(raw, isNotToken) < 0
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue