olafz / percona-clustercheck

Script to make a proxy (ie HAProxy) capable of monitoring Percona XtraDB Cluster nodes properly. The clustercheck script is distributed under the BSD license.
BSD 3-Clause "New" or "Revised" License
173 stars 108 forks source link

Refactor : extracted httpReply function + Improvement : more meaningful error #18

Open jggc opened 8 years ago

jggc commented 8 years ago

Refactor : There were many redundant blocks of echo -en to send the same HTTP headers. Also the hardcoded Content-Length is just a bad idea, it's too easy to modify the content and forgetting to change the Content-Lenght. Also it's not obvious for people who don't speak HTTP very fluently how to calculate the Content-Lenght.

Improvement : For first time users having a message that suggest setting up the user can be helpful. It would have helped me anyway!