Commit 905db5d2 authored by Frank Bergmann's avatar Frank Bergmann

Rest: im_rest_error now returns the passed HTTP status code (304, 4xx, 5xx)...

Rest: im_rest_error now returns the passed HTTP status code (304, 4xx, 5xx) which was ignored previously
parent 528126e9
...@@ -612,7 +612,7 @@ ad_proc -public im_rest_error { ...@@ -612,7 +612,7 @@ ad_proc -public im_rest_error {
switch $format { switch $format {
html { html {
doc_return 200 "text/html" " doc_return $http_status "text/html" "
[im_header $page_title [im_rest_header_extra_stuff]][im_navbar] [im_header $page_title [im_rest_header_extra_stuff]][im_navbar]
<p>$status_message</p> <p>$status_message</p>
<pre>[ns_quotehtml $message]</pre> <pre>[ns_quotehtml $message]</pre>
...@@ -621,13 +621,14 @@ ad_proc -public im_rest_error { ...@@ -621,13 +621,14 @@ ad_proc -public im_rest_error {
} }
json { json {
set result "{\"success\": false,\n\"message\": \"[im_quotejson $message]\"\n}" set result "{\"success\": false,\n\"message\": \"[im_quotejson $message]\"\n}"
doc_return 200 "application/json" $result doc_return $http_status "application/json" $result
} }
default { default {
ad_return_complaint 1 "Invalid format1: '$format'" ad_return_complaint 1 "Invalid format1: '$format'"
} }
} }
ns_log Notice "im_rest_error: before ad_script_abort"
ad_script_abort ad_script_abort
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment