Skip to content

Bad Request(400) is returned when calling Invoke-WebRequest with fragment(#) #7796

@yukihane

Description

@yukihane

Steps to reproduce

Invoke-WebRequest http://localhost/hello#fragment

Expected behavior

On PowerShell 5.1,

Invoke-WebRequest http://localhost/hello#fragment

apache httpd access.log:

 [16/Sep/2018:10:52:18 +0000] "GET /hello HTTP/1.1" 404 203 "-" "Mozilla/5.0 (Windows NT; Windows NT 10.0; ja-JP) WindowsPowerShell/5.1.17134.228"

Actual behavior

apache httpd access.log:

[16/Sep/2018:10:50:50 +0000] "GET /hello#fragment HTTP/1.1" 400 226 "-" "-"

The fragment is not cut off.

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0
PSEdition                      Core
GitCommitId                    6.1.0
OS                             Linux 3.10.0-862.2.3.el7.x86_64 #1 SMP Wed May 9 18:05:47 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility moduleWaiting - DotNetCorewaiting on a fix/change in .NET

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions