AgodaAnalyzers icon indicating copy to clipboard operation
AgodaAnalyzers copied to clipboard

WebAPI controller that return void break iOS

Open dicko2 opened this issue 7 years ago • 1 comments

When a webapi controller returns void, aspnet make it return a 204 instead of 200. iOS/Safari treat this differently and prompt the user for a document download blocking off the website the instant the API method is called from ajax.

We should create a rule that forces all webapi controller methods to return data and not a void.

dicko2 avatar Dec 05 '17 08:12 dicko2

Only little concern about this the referrence that we need to add to "find" inherited members from ApiController/Controller. Should it be a new package beside Agoda.Analyzers.Web? The other parts looks easy to add I think.

Chrissx avatar Dec 05 '17 16:12 Chrissx