gilbitron / Arrest-MySQL

A "plug-n-play" RESTful API for your MySQL database.
131 stars 219 forks source link

Arrest is not returning HTTP code on the header #20

Open limbo200 opened 9 years ago

limbo200 commented 9 years ago

I have noticed that ArrestDB does not set up the HTTP header when a method calls Reply (ArrestDB::Reply(ArrestDB::$HTTP[400])) I'm suggesting you to add this snippet to solve this problem. [ ] 's,

548a549,552
>               if ( is_array($data) && ( array_key_exists('success',$data) || array_key_exists('error',$data)))
>               {
>                   header(sprintf('%s %s %s', $_SERVER["SERVER_PROTOCOL"], $data[key($data)]['code'], $data[key($data)]['status']));
>               }