Skip to content

Bug in HttpWebRequest when call an endpoint that returns 302 #25986

@Petermarcu

Description

@Petermarcu

@mrquake commented on Mon Apr 23 2018

Issue Title

When you call an endpoint that returns 302 the redirection url will have backslashes instead of forward slashes in "localpath".

General

For example when you call Azure API using Fiddler or any other web debugging tool: "https://management.azure.com/subscriptions/xxx-xxx-xxx-xxxx/providers/Microsoft.Commerce/RateCard" with property parameters, token, etc...

It will return 302 and redirect to: https://ratecard.blob.core.windows.net/ratecards/xxxx-xxxx-xxxxx-xxxxx/MS-AZR-0017P/USD/en-US/False/2015-06-01-preview/yyyy-yyyyy-yyyyy-yyyyy.json

No problem whatsoever...

But when you make the request using .NET Core 1.1/2.0 HttpWebRequest...
The redirection tries to call something like that:

https://ratecard.blob.core.windows.net/ratecards/xxxx-xxxx-xxxx-xxxxx%5CMS-AZR-0017P%5CUSD%5Cen-US%5CFalse/2015-06-01-preview/yyyy-yyyy-yyyy-yyyy-yyyy.json

With encoded backslashes instead of forward slashes....

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions