From a586352a0c9e9387987a1645842f4636c65f48be Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Tue, 18 Jan 2011 20:19:44 -0800 Subject: More status code changes. --- pinyweb/cgi-bin/checkconstraint.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pinyweb/cgi-bin/checkconstraint.cgi') diff --git a/pinyweb/cgi-bin/checkconstraint.cgi b/pinyweb/cgi-bin/checkconstraint.cgi index 4ff939c..e0a59c3 100755 --- a/pinyweb/cgi-bin/checkconstraint.cgi +++ b/pinyweb/cgi-bin/checkconstraint.cgi @@ -12,21 +12,21 @@ use Piny; my $q = CGI->new( ); if ( $q->request_method( ) eq "OPTIONS" ) { - print "Status: 204 No Content\nAccess-Control-Allow-Headers: *\nAccess-Control-Allow-Methods: GET, OPTIONS, POST\nAccess-Control-Allow-Origin: *\nAccess-Control-Max-Age: 3600\n\n"; + print "Status: 200 OK\nAccess-Control-Allow-Headers: *\nAccess-Control-Allow-Methods: GET, OPTIONS, POST\nAccess-Control-Allow-Origin: *\nAccess-Control-Max-Age: 3600\nContent-Type: text/plain\n\n"; } else { my $type = $q->param( 't' ); my $value = $q->param( 'v' ); if ( not defined $type or not defined $value ) { - print "Status: 400 Bad Request\nContent-type: application/json\n\n"; + print "Status: 200 OK\nContent-type: application/json\n\n"; print encode_json( { "ok" => JSON::false, "msg" => "Unable to validate due to client-side error, please reload this page. Required parameter missing." } ); } else { my $constraint = find_type_constraint( $type ); if ( not defined $constraint ) { - print "Status: 400 Bad Request\nContent-type: application/json\n\n"; + print "Status: 200 OK\nContent-type: application/json\n\n"; print encode_json( { "ok" => JSON::false, "msg" => "Unable to validate due to client-side error, please reload this page. Invalid constraint name." } ); } else { -- cgit v1.2.3