8000 Change UserAgent App WindowsPowerShell -> PowerShell by markekraus · Pull Request #4914 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Change UserAgent App WindowsPowerShell -> PowerShell #4914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ internal static string App
get
{
string app = string.Format(CultureInfo.InvariantCulture,
"WindowsPowerShell/{0}", PSVersionInfo.PSVersion);
"PowerShell/{0}", PSVersionInfo.PSVersion);
return (app);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" {

# Validate response content
$jsonContent = $result.Output.Content | ConvertFrom-Json
$jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell"
$jsonContent.headers.'User-Agent' | Should MatchExactly '(?<!Windows)PowerShell\/\d+\.\d+\.\d+.*'
}

It "Invoke-WebRequest returns headers dictionary" {
Expand All @@ -477,7 +477,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" {
# Validate response content
$jsonContent = $result.Output.Content | ConvertFrom-Json
$jsonContent.headers.Host | Should Be $Uri.Authority
$jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell"
}

It "Validate Invoke-WebRequest -DisableKeepAlive" {
Expand All @@ -503,7 +502,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" {
# Validate response content
$jsonContent = $result.Output.Content | ConvertFrom-Json
$jsonContent.headers.Host | Should Match $uri.Authority
$jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell"
}

It "Validate Invoke-WebRequest error for -MaximumRedirection" {
Expand Down Expand Up @@ -584,7 +582,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" {
# Validate response content
$jsonContent = $result.Output.Content | ConvertFrom-Json
$jsonContent.headers.Host | Should Be $uri.Authority
$jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell"
}

It "Invoke-WebRequest validate timeout option" {
Expand Down Expand Up @@ -658,7 +655,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" {
# Validate response content
$jsonContent = $result.Output.Content | ConvertFrom-Json
$jsonContent.url | Should Match $uri
$jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell"

# For a GET request, there is no data property to validate.
if ($method -ne "GET")
Expand Down Expand Up @@ -720,7 +716,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" {
$result = ExecuteRequestWithOutFile -cmdletName "Invoke-WebRequest" -uri $uri
$jsonContent = $result.Output | ConvertFrom-Json
$jsonContent.headers.Host | Should Be $uri.Authority
$jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell"
}

It "Validate Invoke-WebRequest handles missing Content-Type in response header" {
Expand Down Expand Up @@ -1322,7 +1317,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" {
$result = ExecuteWebCommand -command $command

# Validate response
$result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell"
$result.Output.headers.'User-Agent' | Should MatchExactly '(?<!Windows)PowerShell\/\d+\.\d+\.\d+.*'
}

It "Invoke-RestMethod returns headers dictionary" {
Expand All @@ -1334,7 +1329,6 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" {

# Validate response
$result.Output.headers.Host | Should Be $Uri.Authority
$result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell"
}

It "Validate Invoke-RestMethod -DisableKeepAlive" {
Expand All @@ -1347,7 +1341,6 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" {

# Validate response
$result.Output.headers.Host | Should Be $uri.Authority
$result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell"
$result.Output.Headers.Connection | Should Be "Close"
}

Expand All @@ -1360,7 +1353,6 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" {

# Validate response
$result.Output.headers.Host | Should Match $uri.Authority
$result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell"
}

It "Validate Invoke-RestMethod error for -MaximumRedirection" {
Expand Down Expand Up @@ -1435,7 +1427,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" {
$result = ExecuteWebCommand -command $command

# Validate response
$result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell"
$result.Output.headers.'User-Agent' | Should MatchExactly '(?<!Windows)PowerShell\/\d+\.\d+\.\d+.*'
}

# Perform the following operation for Invoke-RestMethod
Expand Down Expand Up @@ -1497,7 +1489,6 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" {

# Validate response
$result.Output.url | Should Match $uri
$result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell"

# For a GET request, there is no data property to validate.
if ($method -ne "GET")
Expand Down Expand Up @@ -1525,7 +1516,6 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" {

# Validate response
$result.Output.url | Should Match $uri
$result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell"
$result.Output.Headers.Connection | Should Be "Close"
}

Expand Down Expand Up @@ -1560,7 +1550,6 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" {
$result = ExecuteRequestWithOutFile -cmdletName "Invoke-RestMethod" -uri $uri
$jsonContent = $result.Output | ConvertFrom-Json
$jsonContent.headers.Host | Should Be $uri.Authority
$jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell"
}

It "Validate Invoke-RestMethod handles missing Content-Type in response header" {
Expand Down
0