Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
9cd9c979
Commit
9cd9c979
authored
Apr 19, 2024
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed TestUserAgentHeader and TestProxy
parent
087a6f56
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
.golangci.yml
.golangci.yml
+2
-0
internal/cli/configuration/defaults.go
internal/cli/configuration/defaults.go
+4
-0
internal/cli/configuration/network_test.go
internal/cli/configuration/network_test.go
+2
-1
No files found.
.golangci.yml
View file @
9cd9c979
...
...
@@ -134,5 +134,7 @@ issues:
-
path-except
:
internal/cli/
linters
:
-
forbidigo
-
path
:
internal/cli/.*_test.go
linters
:
[
forbidigo
]
-
path
:
internal/cli/feedback/
linters
:
[
forbidigo
]
internal/cli/configuration/defaults.go
View file @
9cd9c979
...
...
@@ -64,6 +64,10 @@ func SetDefaults(settings *Settings) {
// updater settings
setDefaultValueAndKeyTypeSchema
(
"updater.enable_notification"
,
true
)
// network settings
setKeyTypeSchema
(
"network.proxy"
,
""
)
setKeyTypeSchema
(
"network.user_agent_ext"
,
""
)
}
// InjectEnvVars change settings based on the environment variables values
...
...
internal/cli/configuration/network_test.go
View file @
9cd9c979
...
...
@@ -33,7 +33,7 @@ func TestUserAgentHeader(t *testing.T) {
defer
ts
.
Close
()
settings
:=
configuration
.
NewSettings
()
settings
.
Set
(
"network.user_agent_ext"
,
"test-user-agent"
)
require
.
NoError
(
t
,
settings
.
Set
(
"network.user_agent_ext"
,
"test-user-agent"
)
)
client
,
err
:=
settings
.
NewHttpClient
()
require
.
NoError
(
t
,
err
)
...
...
@@ -46,6 +46,7 @@ func TestUserAgentHeader(t *testing.T) {
b
,
err
:=
io
.
ReadAll
(
response
.
Body
)
require
.
NoError
(
t
,
err
)
fmt
.
Println
(
"RESPONSE:"
,
string
(
b
))
require
.
Contains
(
t
,
string
(
b
),
"test-user-agent"
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment