Scott McArthur - 116 - Mar 28, 2014

Hello,

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:
https://github.com/ServiceStack/ServiceStack/commit/fd7b74a84fd3a5ca08efc808e62cb524022b9c8c

Scott McArthur:

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