Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9cd9c97

Browse filesBrowse files
committed
Fixed TestUserAgentHeader and TestProxy
1 parent 087a6f5 commit 9cd9c97
Copy full SHA for 9cd9c97

File tree

Expand file treeCollapse file tree

3 files changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+8
-1
lines changed

‎.golangci.yml

Copy file name to clipboardExpand all lines: .golangci.yml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,7 @@ issues:
134134
- path-except: internal/cli/
135135
linters:
136136
- forbidigo
137+
- path: internal/cli/.*_test.go
138+
linters: [forbidigo]
137139
- path: internal/cli/feedback/
138140
linters: [forbidigo]

‎internal/cli/configuration/defaults.go

Copy file name to clipboardExpand all lines: internal/cli/configuration/defaults.go
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ func SetDefaults(settings *Settings) {
6464

6565
// updater settings
6666
setDefaultValueAndKeyTypeSchema("updater.enable_notification", true)
67+
68+
// network settings
69+
setKeyTypeSchema("network.proxy", "")
70+
setKeyTypeSchema("network.user_agent_ext", "")
6771
}
6872

6973
// InjectEnvVars change settings based on the environment variables values

‎internal/cli/configuration/network_test.go

Copy file name to clipboardExpand all lines: internal/cli/configuration/network_test.go
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestUserAgentHeader(t *testing.T) {
3333
defer ts.Close()
3434

3535
settings := configuration.NewSettings()
36-
settings.Set("network.user_agent_ext", "test-user-agent")
36+
require.NoError(t, settings.Set("network.user_agent_ext", "test-user-agent"))
3737
client, err := settings.NewHttpClient()
3838
require.NoError(t, err)
3939

@@ -46,6 +46,7 @@ func TestUserAgentHeader(t *testing.T) {
4646
b, err := io.ReadAll(response.Body)
4747
require.NoError(t, err)
4848

49+
fmt.Println("RESPONSE:", string(b))
4950
require.Contains(t, string(b), "test-user-agent")
5051
}
5152

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.