From 1a617eb5335bdba8631094fad74e528d73ecd13b Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Wed, 10 Dec 2014 15:54:06 -0800 Subject: [PATCH] Fix an inadvertent 204 in activator tests On a web server, this test ends up giving back a 204 because of the MVC behavior when an action is declared to return void. The fix is to use EmptyResult. --- .../ActivatorWebSite/Controllers/RegularController.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/WebSites/ActivatorWebSite/Controllers/RegularController.cs b/test/WebSites/ActivatorWebSite/Controllers/RegularController.cs index 208a549588..90bd1a80d6 100644 --- a/test/WebSites/ActivatorWebSite/Controllers/RegularController.cs +++ b/test/WebSites/ActivatorWebSite/Controllers/RegularController.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Threading.Tasks; using Microsoft.AspNet.Http; using Microsoft.AspNet.Mvc; @@ -8,13 +9,15 @@ namespace ActivatorWebSite { public class RegularController : Controller { - public void Index() + public async Task Index() { // This verifies that ModelState and Context are activated. if (ModelState.IsValid) { - Context.Response.WriteAsync("Hello world").Wait(); + await Context.Response.WriteAsync("Hello world"); } + + return new EmptyResult(); } } } \ No newline at end of file