Update iOS render policy and test case, bump version to 0.1.5 (#50)

Update iOS render policy and test case, bump version to 0.1.5.
This commit is contained in:
Nova Kwok 2020-07-14 17:56:16 +08:00 committed by GitHub
parent 6abbc14a84
commit 36eb669031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View File

@ -9,8 +9,9 @@ import (
"path" "path"
"path/filepath" "path/filepath"
log "github.com/sirupsen/logrus"
"strings" "strings"
log "github.com/sirupsen/logrus"
) )
func ChanErr(ccc chan int) { func ChanErr(ccc chan int) {
@ -81,6 +82,7 @@ func goOrigin(UA string) bool {
// on Android and Linux // on Android and Linux
} else if strings.Contains(UA, "FxiOS") || strings.Contains(UA, "CriOS") { } else if strings.Contains(UA, "FxiOS") || strings.Contains(UA, "CriOS") {
//firefox and Chrome on iOS //firefox and Chrome on iOS
return true
} else { } else {
return true return true
} }

View File

@ -3,8 +3,9 @@ package main
import ( import (
"strings" "strings"
"testing" "testing"
"github.com/stretchr/testify/assert"
) )
import "github.com/stretchr/testify/assert"
// test this file: go test -v -cover helper_test.go helper.go // test this file: go test -v -cover helper_test.go helper.go
// test one function: go test -run TestGetFileContentType helper_test.go helper.go -v // test one function: go test -run TestGetFileContentType helper_test.go helper.go -v
@ -70,14 +71,14 @@ func TestGoOrigin(t *testing.T) {
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36": false, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36": false,
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36": false, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36": false,
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36": false, "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36": false,
"Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/83.0.4103.63 Mobile/15E148 Safari/604.1": false, "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/83.0.4103.63 Mobile/15E148 Safari/604.1": true,
"Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.60 Mobile Safari/537.36": false, "Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.60 Mobile Safari/537.36": false,
// Firefox on Windows, macOS, linux, iOS and Android // Firefox on Windows, macOS, linux, iOS and Android
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0": false, "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0": false,
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:76.0) Gecko/20100101 Firefox/76.0": false, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:76.0) Gecko/20100101 Firefox/76.0": false,
"Mozilla/5.0 (X11; Linux i686; rv:76.0) Gecko/20100101 Firefox/76.0": false, "Mozilla/5.0 (X11; Linux i686; rv:76.0) Gecko/20100101 Firefox/76.0": false,
"Mozilla/5.0 (iPad; CPU OS 10_15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/25.0 Mobile/15E148 Safari/605.1.15": false, "Mozilla/5.0 (iPad; CPU OS 10_15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/25.0 Mobile/15E148 Safari/605.1.15": true,
"Mozilla/5.0 (Android 10; Mobile; rv:68.0) Gecko/68.0 Firefox/68.0": false, "Mozilla/5.0 (Android 10; Mobile; rv:68.0) Gecko/68.0 Firefox/68.0": false,
// Safari on macOS and iOS // Safari on macOS and iOS

View File

@ -21,7 +21,7 @@ type Config struct {
ExhaustPath string `json:"EXHAUST_PATH"` ExhaustPath string `json:"EXHAUST_PATH"`
} }
const version = "0.1.4" const version = "0.1.5"
var configPath string var configPath string
var prefetch bool var prefetch bool