No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
8aebf54
... +0 ...
1b94df7
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
15 | 15 | // BasicAuthDecode decodes a key-secret pair from a token string, originally used in a |
|
16 | 16 | // HTTP Basic Authentication strategy (HTTP Request Header) |
|
17 | 17 | func BasicAuthDecode(token string) (string, string) { |
|
18 | - | bytes, _ := base64.StdEncoding.DecodeString(token) |
|
18 | + | bytes, err := base64.StdEncoding.DecodeString(token) |
|
19 | + | if err != nil { |
|
20 | + | return "", "" |
|
21 | + | } |
|
19 | 22 | values := strings.Split(string(bytes), ":") |
|
23 | + | if len(values) < 2 { |
|
24 | + | return "", "" |
|
25 | + | } |
|
20 | 26 | return values[0], values[1] |
|
21 | 27 | } |
|
28 | + | ||
29 | + | // MustServeJSON determines if the HTTP response must be a JSON content or not |
|
30 | + | // using the HTTP request path and the request header attribute `Accept` |
|
31 | + | func MustServeJSON(path string, accept string) bool { |
|
32 | + | return strings.HasPrefix(path, "/api") || |
|
33 | + | strings.HasPrefix(path, "/token") || |
|
34 | + | strings.HasPrefix(path, "/oauth/token") |
|
35 | + | } |
Files | Coverage |
---|---|
config.go | 12.12% |
configuration_store.go | 0.00% |
Folder Totals (2 files) | 10.26% |
Project Totals (18 files) | 14.29% |
1b94df7
8aebf54