Skip to content
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

[releaes/3.2.8] Get builds working again #302

Merged
merged 4 commits into from
Jul 29, 2021
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 @@ -10,8 +10,8 @@
namespace System.Net.Http.Formatting.Parsers
{
/// <summary>
/// Buffer-oriented RFC 5322 style Internet Message Format parser which can be used to pass header
/// fields used in HTTP and MIME message entities.
/// Buffer-oriented RFC 5322 style Internet Message Format parser which can be used to pass header
/// fields used in HTTP and MIME message entities.
/// </summary>
internal class InternetMessageFormatHeaderParser
{
Expand Down Expand Up @@ -76,7 +76,7 @@ private enum HeaderFieldState

/// <summary>
/// Parse a buffer of RFC 5322 style header fields and add them to the <see cref="HttpHeaders"/> collection.
/// Bytes are parsed in a consuming manner from the beginning of the buffer meaning that the same bytes can not be
/// Bytes are parsed in a consuming manner from the beginning of the buffer meaning that the same bytes can not be
/// present in the buffer.
/// </summary>
/// <param name="buffer">Request buffer from where request is read</param>
Expand Down Expand Up @@ -283,7 +283,7 @@ private static ParserState ParseHeaderFields(
}

/// <summary>
/// Maintains information about the current header field being parsed.
/// Maintains information about the current header field being parsed.
/// </summary>
private class CurrentHeaderFieldStore
{
Expand Down Expand Up @@ -320,6 +320,10 @@ public void CopyTo(HttpHeaders headers, bool ignoreHeaderValidation)
{
var name = _name.ToString();
var value = _value.ToString().Trim(CurrentHeaderFieldStore._linearWhiteSpace);
if (string.Equals("expires", name, StringComparison.OrdinalIgnoreCase))
{
ignoreHeaderValidation = true;
}

if (ignoreHeaderValidation)
{
Expand Down
2 changes: 2 additions & 0 deletions src/WebApiHelpPage/VB/WebApiHelpPageVB.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<RunCodeAnalysis>$(CodeAnalysis)</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\Strict.ruleset</CodeAnalysisRuleSet>
<MyType>Windows</MyType>
<!-- Ignore warning about deprecated <licenseUrl> in the .nuspec. -->
<NoWarn Condition=" '$(MSBuildRuntimeType)' == 'core' ">$(NoWarn);NU5125</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineDebug>true</DefineDebug>
Expand Down
2 changes: 2 additions & 0 deletions src/WebApiHelpPage/WebApiHelpPage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<CodeAnalysisRuleSet>..\Strict.ruleset</CodeAnalysisRuleSet>
<DefineConstants>$(DefineConstants);ASPNETMVC</DefineConstants>
<NoWarn>1591</NoWarn>
<!-- Ignore warning about deprecated <licenseUrl> in the .nuspec. -->
<NoWarn Condition=" '$(MSBuildRuntimeType)' == 'core' ">$(NoWarn);NU5125</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion test/Microsoft.TestCommon/PlatformInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private static Platform GetPlatform()
{
if (Type.GetType(_netCore20TypeName, throwOnError: false) != null)
{
// Treat .NET Core 2.0 as a .NET 4.5 superset though internal types are different.
// Treat .NET Core 2.1 as a .NET 4.5 superset though internal types are different.
return Platform.Net45;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Runtime.sln))\tools\WebStack.settings.targets" />
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<RootNamespace>System.Net.Http</RootNamespace>
<AssemblyName>System.Net.Http.Formatting.NetStandard.Test</AssemblyName>
<OutputPath>..\..\bin\$(Configuration)\Test\</OutputPath>
Expand Down
4 changes: 2 additions & 2 deletions test/System.Net.Http.Formatting.Test/DataSets/HttpTestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ public static TheoryDataSet<string, string, bool> ReadAndWriteCorrectCharacterEn
{ "This is a test 激光這兩個字是甚麼意思 string written using utf-8", "utf-8", true },
{ "This is a test 激光這兩個字是甚麼意思 string written using utf-16", "utf-16", true },
{ "This is a test 激光這兩個字是甚麼意思 string written using utf-32", "utf-32", false },
#if !NETCOREAPP2_0 // shift_jis and iso-2022-kr are not supported when running on .NET Core 2.0.
#if !NETCOREAPP // shift_jis and iso-2022-kr are not supported when running on .NET Core 2.1.
{ "This is a test 激光這兩個字是甚麼意思 string written using shift_jis", "shift_jis", false },
#endif
{ "This is a test æøå string written using iso-8859-1", "iso-8859-1", false },
#if !NETCOREAPP2_0
#if !NETCOREAPP
{ "This is a test 레이저 단어 뜻 string written using iso-2022-kr", "iso-2022-kr", false },
#endif
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public async Task ReadFromStreamAsync_RoundTripsWriteToStreamAsync_DBNullAsNull(
Assert.Null(readObj);
}

#if !NETCOREAPP2_0 // DBNull not serializable on .NET Core 2.0 except at top level (using BsonMediaTypeformatter special case).
#if !NETCOREAPP // DBNull not serializable on .NET Core 2.1 except at top level (using BsonMediaTypeformatter special case).
[Theory]
[TestDataSet(typeof(JsonMediaTypeFormatterTests), "DBNullAsObjectTestDataCollection", TestDataVariations.AsDictionary)]
public async Task ReadFromStreamAsync_RoundTripsWriteToStreamAsync_DBNullAsNull_Dictionary(Type variationType, object testData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public async Task ReadFromStreamAsync_RoundTripsWriteToStreamAsync_KnownTypes(Ty
}
}

#if !NETCOREAPP2_0 // DBNull not serializable on .NET Core 2.0.
#if !NETCOREAPP // DBNull not serializable on .NET Core 2.1.
// Test alternate null value
[Fact]
public async Task ReadFromStreamAsync_RoundTripsWriteToStreamAsync_DBNull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public async Task ReadFromStreamAsync_RoundTripsWriteToStreamAsync(Type variatio
}
}

#if !NETCOREAPP2_0 // DBNull not serializable on .NET Core 2.0.
#if !NETCOREAPP // DBNull not serializable on .NET Core 2.1.
// Test alternate null value; always serialized as "null"
[Theory]
[TestDataSet(typeof(JsonMediaTypeFormatterTests), "DBNullAsObjectTestDataCollection", TestDataVariations.AllSingleInstances)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public Task DeserializingDeepArraysThrows()
// low surrogate not preceded by high surrogate
[InlineData("ABC \\udc00\\ud800 DEF", "ABC \ufffd\ufffd DEF")]
// make sure unencoded invalid surrogate characters don't make it through
#if NETCOREAPP2_0 // Json.NET uses its regular invalid Unicode character on .NET Core 2.0; '?' elsewhere.
#if NETCOREAPP // Json.NET uses its regular invalid Unicode character on .NET Core 2.1; '?' elsewhere.
[InlineData("\udc00\ud800\ud800", "\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd")]
#else
[InlineData("\udc00\ud800\ud800", "??????")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class XmlMediaTypeFormatterTests : MediaTypeFormatterTestBase<XmlMediaTyp
Int32.MaxValue,
Int64.MinValue,
Int64.MaxValue,
#if !NETCOREAPP2_0 // DBNull not serializable on .NET Core 2.0.
#if !NETCOREAPP // DBNull not serializable on .NET Core 2.1.
DBNull.Value,
#endif
});
Expand Down Expand Up @@ -484,7 +484,7 @@ public async Task ReadFromStream_AsyncRoundTripsWriteToStreamUsingDataContractSe
}
}

#if !NETCOREAPP2_0 // DBNull not serializable on .NET Core 2.0.
#if !NETCOREAPP // DBNull not serializable on .NET Core 2.1.
[Fact]
public async Task ReadFromStreamAsync_RoundTripsWriteToStreamAsyncUsingDataContractSerializer_DBNull()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace System.Net.Http.Internal
{
public class HttpValueCollectionTest
{
#if !NETCOREAPP2_0 // Unused on .NET Core 2.0.
#if !NETCOREAPP // Unused on .NET Core 2.1.
private static readonly int _maxCollectionKeys = 1000;
#endif

Expand Down Expand Up @@ -148,7 +148,7 @@ public void Create_CreatesEmptyCollection()
Assert.Empty(nvc);
}

#if !NETCOREAPP2_0 // DBNull not serializable on .NET Core 2.0.
#if !NETCOREAPP // DBNull not serializable on .NET Core 2.1.
// This set of tests requires running on a separate appdomain so we don't
// touch the static property MediaTypeFormatter.MaxHttpCollectionKeys.
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class MultipartFileStreamProviderTests : MultipartStreamProviderTestBase<
private const int ValidBufferSize = 0x111;
private const string ValidPath = @"c:\some\path";

#if !NETCOREAPP // .NET Core does not enforce path validity in many APIs.
public static TheoryDataSet<string> NotSupportedFilePaths
{
get
Expand All @@ -44,6 +45,7 @@ public static TheoryDataSet<string> NotSupportedFilePaths
};
}
}
#endif

public static TheoryDataSet<string> InvalidFilePaths
{
Expand All @@ -52,15 +54,17 @@ public static TheoryDataSet<string> InvalidFilePaths
return new TheoryDataSet<string>
{
"",
" ",
" ",
" ",
"\t\t \n ",
#if !NETCOREAPP // .NET Core does not enforce path validity in many APIs.
"\t\t \n ",
"c:\\a<b",
"c:\\a>b",
"c:\\a\"b",
"c:\\a\tb",
"c:\\a|b",
"c:\\a\bb",
#endif
"c:\\a\0b",
"c :\\a\0b",
};
Expand All @@ -73,12 +77,14 @@ public void Constructor_ThrowsOnNullRootPath()
Assert.ThrowsArgumentNull(() => { new MultipartFileStreamProvider(null); }, "rootPath");
}

#if !NETCOREAPP // .NET Core does not enforce path validity in many APIs.
[Theory]
[PropertyData("NotSupportedFilePaths")]
public void Constructor_ThrowsOnNotSupportedRootPath(string notSupportedPath)
{
Assert.Throws<NotSupportedException>(() => new MultipartFileStreamProvider(notSupportedPath, ValidBufferSize));
}
#endif

[Theory]
[PropertyData("InvalidFilePaths")]
Expand Down