<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why WebFramework's responses with a non-200 HTTP Status Code always return the same, post-6.2.x? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159358#M2164</link>
    <description>&lt;P&gt;Thank you, a lot. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; This is a rather crippling bug on any javascript that relied on the response bodies &lt;EM&gt;(in addition to status codes)&lt;/EM&gt;... but then again, this laying around a few months now &lt;EM&gt;(unfortunately I had no time to report it earlier.. had hurries everywhere)&lt;/EM&gt; makes it look like not too many use the Django side in-depth. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Mar 2015 20:27:10 GMT</pubDate>
    <dc:creator>CynthiaMhav</dc:creator>
    <dc:date>2015-03-03T20:27:10Z</dc:date>
    <item>
      <title>Why WebFramework's responses with a non-200 HTTP Status Code always return the same, post-6.2.x?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159356#M2162</link>
      <description>&lt;P&gt;Before the Splunk Enterprise version 6.2.x &lt;EM&gt;(e.g. in 6.1.x)&lt;/EM&gt; I could still write in WebFramework &lt;EM&gt;(Django -based one)&lt;/EM&gt;, to return HTTP response with Status Code of 400, 404, or 500, with a custom message body.&lt;/P&gt;

&lt;P&gt;I could do this by, either using Django Framework's ready "HttpResponseBadRequest", "HttpRequestNotFound", and "HttpResponseServerError" -objects, or using the plain "HttpResponse" -object specifying the Status Code as a parameter.&lt;/P&gt;

&lt;P&gt;So I could create for example a 500-Code message with a message "Subsystem X failed - request not delivered", should the program logic fail accordingly. I could even use the Django's HTTP-Exception shortcuts (e.g. 'raise Http404("These drones aren't what you are looking for.")'.&lt;/P&gt;

&lt;P&gt;Since 6.2.x the HttpRequest with a Status Code of 200 &lt;EM&gt;(thankfully)&lt;/EM&gt; works fine - else it'd be impossible to code by Web Framework anymore... But any other Status Code seems to get overwritten into a default XML message &lt;EM&gt;(apparently defined in *&lt;/EM&gt;$SPLUNK_ROOT/lib/python2.7/site-packages/splunk/appserver/mrsparkle/controllers.proxy.py** ... I didn't have time yet, to reverse engineer that issue further in-code)*. This makes it impossible to return custom 404 pages, or error messages/reasons, effectively breaking any old javascript that relied on these...&lt;/P&gt;

&lt;P&gt;So I have two options to go with:&lt;BR /&gt;
 - Either I refactor all serverside error messages to return Http Status "200 - OK", and refactor also all client-side code to expect ONLY 200 code, parsing it's content... but this is a lot less error resilient &lt;EM&gt;(than checking the Status Code)&lt;/EM&gt;, and makes the server-side code rather ambiguous.&lt;BR /&gt;
 - Or I overwrite the respective CherryPy module, that makes this change. I'd rather not go on with this, as it could produce Unforseen Consequences™, and has to be re-implemented on each version update...&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Any information on whether this was an intended change, or not, and what is the likely version for it to be "fixed" (if will), would be really much appreciated.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 09:51:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159356#M2162</guid>
      <dc:creator>CynthiaMhav</dc:creator>
      <dc:date>2015-02-25T09:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Why WebFramework's responses with a non-200 HTTP Status Code always return the same, post-6.2.x?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159357#M2163</link>
      <description>&lt;P&gt;I think this is a bug. I have filed it internally as SPL-97569 and instructed that this thread be updated when the ticket is completed. I have no ETA.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2015 19:31:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159357#M2163</guid>
      <dc:creator>dfoster_splunk</dc:creator>
      <dc:date>2015-03-03T19:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why WebFramework's responses with a non-200 HTTP Status Code always return the same, post-6.2.x?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159358#M2164</link>
      <description>&lt;P&gt;Thank you, a lot. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; This is a rather crippling bug on any javascript that relied on the response bodies &lt;EM&gt;(in addition to status codes)&lt;/EM&gt;... but then again, this laying around a few months now &lt;EM&gt;(unfortunately I had no time to report it earlier.. had hurries everywhere)&lt;/EM&gt; makes it look like not too many use the Django side in-depth. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2015 20:27:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159358#M2164</guid>
      <dc:creator>CynthiaMhav</dc:creator>
      <dc:date>2015-03-03T20:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why WebFramework's responses with a non-200 HTTP Status Code always return the same, post-6.2.x?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159359#M2165</link>
      <description>&lt;P&gt;Django is receiving less active dev attention now than in the past. Migrating to Simple XML + HTML panels + JS/CSS extensions is a more stable path moving forward if you have resources to make such a transition. -- Much of our existing docs are not up-to-date on this point.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2015 20:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159359#M2165</guid>
      <dc:creator>dfoster_splunk</dc:creator>
      <dc:date>2015-03-03T20:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why WebFramework's responses with a non-200 HTTP Status Code always return the same, post-6.2.x?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159360#M2166</link>
      <description>&lt;P&gt;We're currently using &lt;STRONG&gt;both&lt;/STRONG&gt; Django and SimpleXML (&lt;EM&gt;in an unintended/ad-hoc way, in order to add some non-indexed data to the non-dashboard views, i.e. RDBMS data that's constantly fluctuating by relations - so less suitable for indexing..&lt;/EM&gt;). Good to know, though. Thanks again. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2015 12:21:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-WebFramework-s-responses-with-a-non-200-HTTP-Status-Code/m-p/159360#M2166</guid>
      <dc:creator>CynthiaMhav</dc:creator>
      <dc:date>2015-03-04T12:21:33Z</dc:date>
    </item>
  </channel>
</rss>

