Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phil Dye 149 posts 325 karma points
    Jul 29, 2013 @ 11:46
    Phil Dye
    0

    Base methods revealing stack trace

    I've got a site that makes extensive use of /Base methods to expose data via JSON, but can't disable verbose stack traces (usually the opposite problem!).

    All the usual web.config settings are set to production;

    <add key="umbracoDebugMode" value="false" />
    <customErrors mode="RemoteOnly" />
    <trace enabled="false" ...
    <httpErrors existingResponse="PassThrough">
                <remove statusCode="500" subStatusCode="-1" />
                <error statusCode="500" prefixLanguageFilePath="" path="/error.html" responseMode="ExecuteURL" />
    </httpErrors>

    Yet when poked, the /Base methods expose a full stacktrace.

    Any ideas how I can prevent this? Is it inherent to base methods?

    Phil

     

  • Phil Dye 149 posts 325 karma points
    Jul 29, 2013 @ 11:52
    Phil Dye
    0

    Looks like this might be inherent - from the Umbraco source;

    Umbraco\src\Umbraco.Web\BaseRest\BaseRestHandler.cs:85

    var result = method.Invoke(urlParts.Skip(2).ToArray());
    if (result.Length >= 7 && result.Substring(0, 7) == "<error>")
    {
    context.Response.StatusCode = 500;
    context.Response.StatusDescription = "Internal Server Error";
    }
    context.Response.Output.Write(result);


    That to me looks like the result of the base method is always returned in the response.  I guess I need to try {} catch {} everything, and return my own error?

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies