-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for Restricted Response headers (#169)
* WebHeaderCollection.IsRestricted (#148) * Update dependencies * 1.0.4.7
- Loading branch information
Showing
12 changed files
with
186 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
https://github.com/GitTools/GitReleaseNotes | ||
|
||
GitReleaseNotes.exe . /OutputFile CHANGELOG.md /Version 1.0.4.6 | ||
GitReleaseNotes.exe . /OutputFile CHANGELOG.md /Version 1.0.4.7 | ||
|
||
GitReleaseNotes.exe . /OutputFile CHANGELOG.md /allTags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System.IO; | ||
using System.Reflection; | ||
using log4net; | ||
using log4net.Config; | ||
using log4net.Repository; | ||
using Newtonsoft.Json; | ||
using WireMock.Logging; | ||
using WireMock.RequestBuilders; | ||
using WireMock.ResponseBuilders; | ||
using WireMock.Server; | ||
using WireMock.Settings; | ||
|
||
namespace WireMock.Net.Console.NETCoreApp | ||
{ | ||
static class Program | ||
{ | ||
private static readonly ILoggerRepository LogRepository = LogManager.GetRepository(Assembly.GetEntryAssembly()); | ||
private static readonly ILog Log = LogManager.GetLogger(typeof(Program)); | ||
|
||
static void Main(params string[] args) | ||
{ | ||
XmlConfigurator.Configure(LogRepository, new FileInfo("log4net.config")); | ||
|
||
string url = "http://localhost:9999/"; | ||
|
||
var server = FluentMockServer.Start(new FluentMockServerSettings | ||
{ | ||
Urls = new[] { url }, | ||
StartAdminInterface = true, | ||
Logger = new WireMockConsoleLogger() | ||
}); | ||
System.Console.WriteLine("FluentMockServer listening at {0}", string.Join(",", server.Urls)); | ||
|
||
server.SetBasicAuthentication("a", "b"); | ||
|
||
server.AllowPartialMapping(); | ||
|
||
server | ||
.Given(Request.Create() | ||
.UsingGet() | ||
.WithHeader("Keep-Alive-Test", "stef") | ||
) | ||
.RespondWith(Response.Create() | ||
.WithHeader("Keep-Alive", "timeout=1, max=1") | ||
.WithBody("Keep-Alive OK") | ||
); | ||
|
||
System.Console.WriteLine("Press any key to stop the server"); | ||
System.Console.ReadKey(); | ||
server.Stop(); | ||
|
||
System.Console.WriteLine("Displaying all requests"); | ||
var allRequests = server.LogEntries; | ||
System.Console.WriteLine(JsonConvert.SerializeObject(allRequests, Formatting.Indented)); | ||
|
||
System.Console.WriteLine("Press any key to quit"); | ||
System.Console.ReadKey(); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
examples/WireMock.Net.Console.HeadersTest/WireMock.Net.Console.HeadersTest.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp1.1</TargetFramework> | ||
<ApplicationIcon>../../WireMock.Net-Logo.ico</ApplicationIcon> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" /> | ||
<PackageReference Include="log4net" Version="2.0.8" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="log4net.config"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="nlog.config"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<configSections> | ||
<section name="log4net" type="System.Configuration.IgnoreSectionHandler" /> | ||
</configSections> | ||
<appSettings> | ||
<add key="log4net.Internal.Debug" value="true"/> | ||
</appSettings> | ||
<log4net> | ||
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"> | ||
<layout type="log4net.Layout.PatternLayout"> | ||
<conversionPattern value="%date [%thread] %-5level %logger{1} - %message%newline" /> | ||
</layout> | ||
</appender> | ||
<root> | ||
<level value="DEBUG" /> | ||
<appender-ref ref="ConsoleAppender" /> | ||
</root> | ||
</log4net> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
autoReload="true" | ||
internalLogLevel="info" | ||
internalLogFile="c:\temp\wiremock-internal-nlog.log"> | ||
|
||
<targets> | ||
<!-- write logs to file --> | ||
<target xsi:type="File" name="all" fileName="c:\temp\wiremock-${shortdate}.log" | ||
layout="${longdate}|${event-properties:item=EventId.Id}|${uppercase:${level}}|${logger}|${message} ${exception}" /> | ||
</targets> | ||
|
||
<!-- rules to map from logger name to target --> | ||
<rules> | ||
<logger name="*" minlevel="Debug" writeTo="all" /> | ||
</rules> | ||
</nlog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters