Update sample4.cs (#4859)

* Update sample4.cs

In OWIN version 4.0 (prerelease) you cannot compare string with Path directly. You must get its value first

* Update sample4.cs
pull/4870/head
sultanimbayev 2017-11-28 10:15:55 +06:00 committed by Rick Anderson
parent c190a8dd51
commit 9add7f5ec6
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ public void Configuration(IAppBuilder app)
app.Run(context =>
{
// New code: Throw an exception for this URI path.
if (context.Request.Path == "/fail")
if (context.Request.Path.Equals(new PathString("/fail")))
{
throw new Exception("Random exception");
}
@ -14,4 +14,4 @@ public void Configuration(IAppBuilder app)
context.Response.ContentType = "text/plain";
return context.Response.WriteAsync("Hello, world.");
});
}
}