Scott McArthur - 116 - Mar 28, 2014


If I disable the HTML feature and have the default content type set to JSON, like this:

public override void Configure(Funq.Container container)
    SetConfig(new HostConfig { 
        DefaultContentType = MimeTypes.Json,
        EnableFeatures = Feature.All.Remove(Feature.Html)

Then make a request to a route from a web browser without explicitly specifying I want JSON content I get “Forbidden”.

However when looking at the “Accept” header:
Accept: text/html,/;q=0.9

It specifies that it will accept /. Why can’t ServiceStack then honour with a default response? i.e. application/json

yeah it should work like that, looking into it

Hey Scott, is “/” meant to be “/”?

Should now be fixed with this commit:

Scott McArthur:

Thanks Demis, that’s great. Yeah I couldn’t get G+ to format that string properly. Your commit look spot on. Cheers.