mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-27 13:19:31 -10:00
Ported more HTTP related tests. These tests focus mostly on POST scenarios mixed with authentication, pre-authentication, and the "rewind-ability" of content if it needs to be re-POST'd due to AUTH challeges by the server. Added a new HttpTestServers2 class to Common/tests/System/Net. This is a point-in-time thing as we improve the test infrastructure capability. In particular, we are moving away from the use of the "httpbin.org" server. Our new networking test server that we are bringing up has more features than httpbin.org. It can support all the main HTTP verbs when doing "echo" of request headers. It includes a "Content-MD5" HTTP response header. This contains a hash of the response body. This makes it easier to validate the returned payloads. The "httpbin.org" server also has a bug where it does not properly echo chunked upload headers which was causing issues when trying to port these tests. I did not change other networking tests still using "httpbin.org" and the Common HttpTestServers class. I will be doing that later as we finalize the test infrastructure. Commit migrated from https://github.com/dotnet/corefx/commit/f14225a7355bdae2468bb3c28562da0a0976f206
28 lines
875 B
C#
28 lines
875 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
using System;
|
|
using System.IO;
|
|
using System.Security.Authentication.ExtendedProtection;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace System.Net.Http.Functional.Tests
|
|
{
|
|
public sealed class ChannelBindingAwareContent : StringContent
|
|
{
|
|
public ChannelBindingAwareContent(string content) : base(content)
|
|
{
|
|
}
|
|
|
|
public ChannelBinding ChannelBinding { get ; private set; }
|
|
|
|
protected override Task SerializeToStreamAsync(Stream stream, TransportContext context)
|
|
{
|
|
ChannelBinding = context.GetChannelBinding(ChannelBindingKind.Endpoint);
|
|
|
|
return base.SerializeToStreamAsync(stream, context);
|
|
}
|
|
}
|
|
}
|