Skip to content

Commit 407402d

Browse files
author
Kevin Kibler
committed
Added a new project that targets .NET Standard 2.0. Fixed a bug passing extra headers in old .NET Standard project. Fixes #61.
1 parent ed511ef commit 407402d

File tree

13 files changed

+160
-11
lines changed

13 files changed

+160
-11
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<None Remove="ClientTests\.keep" />
11+
<None Remove="ComponentEmitterTests\.keep" />
12+
<None Remove="ModulesTests\.keep" />
13+
<None Remove="ParserTests\.keep" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\BinaryPollingTest.cs" Link="ClientTests\BinaryPollingTest.cs" />
18+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\BinaryWebSocketTest.cs" Link="ClientTests\BinaryWebSocketTest.cs" />
19+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\Connection.cs" Link="ClientTests\Connection.cs" />
20+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\ConnectionConstants.cs" Link="ClientTests\ConnectionConstants.cs" />
21+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\ConnectionTest.cs" Link="ClientTests\ConnectionTest.cs" />
22+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\HandshakeDataTests.cs" Link="ClientTests\HandshakeDataTests.cs" />
23+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\ServerConnectionTest.cs" Link="ClientTests\ServerConnectionTest.cs" />
24+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\SocketTest.cs" Link="ClientTests\SocketTest.cs" />
25+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\SSLServerConnectionTest.cs" Link="ClientTests\SSLServerConnectionTest.cs" />
26+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\TransportTest.cs" Link="ClientTests\TransportTest.cs" />
27+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ClientTests\UsageTest.cs" Link="ClientTests\UsageTest.cs" />
28+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ComponentEmitterTests\EmitterTests.cs" Link="ComponentEmitterTests\EmitterTests.cs" />
29+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ModulesTests\ParseQSTests.cs" Link="ModulesTests\ParseQSTests.cs" />
30+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ModulesTests\UTF8Tests.cs" Link="ModulesTests\UTF8Tests.cs" />
31+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ParserTests\DecodeTests.cs" Link="ParserTests\DecodeTests.cs" />
32+
<Compile Include="..\EngineIoClientDotNet.Tests.mono\ParserTests\TestsParser.cs" Link="ParserTests\TestsParser.cs" />
33+
</ItemGroup>
34+
35+
36+
<ItemGroup>
37+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.0" />
38+
<PackageReference Include="xunit" Version="2.3.1" />
39+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
40+
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
41+
</ItemGroup>
42+
43+
44+
<ItemGroup>
45+
<Folder Include="ClientTests\" />
46+
<Folder Include="ClientTests\" />
47+
</ItemGroup>
48+
49+
50+
<ItemGroup>
51+
<ProjectReference Include="..\EngineIoClientDotNet.netstandard20\EngineIoClientDotNet.netstandard20.csproj" />
52+
</ItemGroup>
53+
54+
55+
</Project>

Src/EngineIoClientDotNet.mono/Client/Transports/PollingXHR_netstandard.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ protected XHRRequest Request(XHRRequest.RequestOptions opts)
3333
}
3434
opts.Uri = Uri();
3535

36+
opts.ExtraHeaders = this.ExtraHeaders;
3637
var req = new XHRRequest(opts);
3738

3839
req.On(EVENT_REQUEST_HEADERS, new EventRequestHeadersListener(this)).
@@ -286,13 +287,11 @@ public void Create()
286287
{
287288
httpContent.Headers.Add(@"Cookie", CookieHeaderValue);
288289
}
289-
if (ExtraHeaders != null)
290-
{
291-
foreach (var header in ExtraHeaders)
292-
{
293-
httpContent.Headers.Add(header.Key, header.Value);
294-
}
295-
}
290+
if (ExtraHeaders != null) {
291+
foreach (var header in ExtraHeaders) {
292+
client.DefaultRequestHeaders.Add(header.Key, header.Value);
293+
}
294+
}
296295

297296
if (Method == "GET")
298297
{

Src/EngineIoClientDotNet.netstandard20/Client/.keep

Whitespace-only changes.

Src/EngineIoClientDotNet.netstandard20/Client/Transports/.keep

Whitespace-only changes.

Src/EngineIoClientDotNet.netstandard20/ComponentEmitter/.keep

Whitespace-only changes.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
6+
<Description>This is the Engine.IO Client Library for C#.</Description>
7+
<PackageProjectUrl>https://github.com/Quobject/EngineIoClientDotNet/</PackageProjectUrl>
8+
<Version>1.0.6</Version>
9+
<Copyright>Copyright © 2018</Copyright>
10+
<RepositoryUrl>https://github.com/Quobject/EngineIoClientDotNet/</RepositoryUrl>
11+
<AssemblyVersion>1.0.6.0</AssemblyVersion>
12+
<FileVersion>1.0.6.0</FileVersion>
13+
<RootNamespace>Quobject.EngineIoClientDotNet</RootNamespace>
14+
<AssemblyName>EngineIoClientDotNet</AssemblyName>
15+
</PropertyGroup>
16+
17+
<ItemGroup>
18+
<None Remove="Client\.keep" />
19+
<None Remove="Client\Transports\.keep" />
20+
<None Remove="ComponentEmitter\.keep" />
21+
<None Remove="Modules\.keep" />
22+
<None Remove="Parser\.keep" />
23+
<None Remove="Thread\.keep" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<Compile Include="..\EngineIoClientDotNet.mono\Client\EngineIOException.cs" Link="Client\EngineIOException.cs" />
28+
<Compile Include="..\EngineIoClientDotNet.mono\Client\HandshakeData.cs" Link="Client\HandshakeData.cs" />
29+
<Compile Include="..\EngineIoClientDotNet.mono\Client\Socket.cs" Link="Client\Socket.cs" />
30+
<Compile Include="..\EngineIoClientDotNet.mono\Client\Transport.cs" Link="Client\Transport.cs" />
31+
<Compile Include="..\EngineIoClientDotNet.mono\Client\Transports\Polling.cs" Link="Client\Transports\Polling.cs" />
32+
<Compile Include="..\EngineIoClientDotNet.mono\Client\Transports\PollingXHR.cs" Link="Client\Transports\PollingXHR.cs" />
33+
<Compile Include="..\EngineIoClientDotNet.mono\Client\Transports\WebSocket.cs" Link="Client\Transports\WebSocket.cs" />
34+
<Compile Include="..\EngineIoClientDotNet.mono\ComponentEmitter\Emitter.cs" Link="ComponentEmitter\Emitter.cs" />
35+
<Compile Include="..\EngineIoClientDotNet.mono\Modules\Global.cs" Link="Modules\Global.cs" />
36+
<Compile Include="..\EngineIoClientDotNet.mono\Modules\LogManager.cs" Link="Modules\LogManager.cs" />
37+
<Compile Include="..\EngineIoClientDotNet.mono\Modules\ParseQS.cs" Link="Modules\ParseQS.cs" />
38+
<Compile Include="..\EngineIoClientDotNet.mono\Modules\ServerCertificate.cs" Link="Modules\ServerCertificate.cs" />
39+
<Compile Include="..\EngineIoClientDotNet.mono\Modules\UTF8.cs" Link="Modules\UTF8.cs" />
40+
<Compile Include="..\EngineIoClientDotNet.mono\Modules\UTF8Exception.cs" Link="Modules\UTF8Exception.cs" />
41+
<Compile Include="..\EngineIoClientDotNet.mono\Parser\Buffer.cs" Link="Parser\Buffer.cs" />
42+
<Compile Include="..\EngineIoClientDotNet.mono\Parser\ByteBuffer.cs" Link="Parser\ByteBuffer.cs" />
43+
<Compile Include="..\EngineIoClientDotNet.mono\Parser\IDecodePayloadCallback.cs" Link="Parser\IDecodePayloadCallback.cs" />
44+
<Compile Include="..\EngineIoClientDotNet.mono\Parser\IEncodeCallback.cs" Link="Parser\IEncodeCallback.cs" />
45+
<Compile Include="..\EngineIoClientDotNet.mono\Parser\Packet.cs" Link="Parser\Packet.cs" />
46+
<Compile Include="..\EngineIoClientDotNet.mono\Parser\Parser.cs" Link="Parser\Parser.cs" />
47+
<Compile Include="..\EngineIoClientDotNet.mono\Thread\EasyTimer.cs" Link="Thread\EasyTimer.cs" />
48+
</ItemGroup>
49+
50+
<ItemGroup>
51+
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
52+
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
53+
<PackageReference Include="WebSocket4Net" Version="0.15.2" />
54+
</ItemGroup>
55+
56+
</Project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27428.2015
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EngineIoClientDotNet.netstandard20", "EngineIoClientDotNet.netstandard20.csproj", "{E25DDD5A-C5A6-4B5E-B1F1-2457BD11C635}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EngineIoClientDotNet.Tests.netstandard20", "..\EngineIoClientDotNet.Tests.netstandard20\EngineIoClientDotNet.Tests.netstandard20.csproj", "{FD5BC014-5F33-41F1-A6CC-C7CE5D076384}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{E25DDD5A-C5A6-4B5E-B1F1-2457BD11C635}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{E25DDD5A-C5A6-4B5E-B1F1-2457BD11C635}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{E25DDD5A-C5A6-4B5E-B1F1-2457BD11C635}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{E25DDD5A-C5A6-4B5E-B1F1-2457BD11C635}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{FD5BC014-5F33-41F1-A6CC-C7CE5D076384}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{FD5BC014-5F33-41F1-A6CC-C7CE5D076384}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{FD5BC014-5F33-41F1-A6CC-C7CE5D076384}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{FD5BC014-5F33-41F1-A6CC-C7CE5D076384}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {D7AFA865-C617-4DDF-B6F9-46CBB8A35EAE}
30+
EndGlobalSection
31+
EndGlobal

Src/EngineIoClientDotNet.netstandard20/Modules/.keep

Whitespace-only changes.

Src/EngineIoClientDotNet.netstandard20/Parser/.keep

Whitespace-only changes.

Src/EngineIoClientDotNet.netstandard20/Thread/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)