[Groonga-commit] groonga/gcs-console [master] Validate endpoint format

Zurück zum Archiv-Index

Yoji SHIDARA null+****@clear*****
Wed Dec 5 13:54:41 JST 2012


Yoji SHIDARA	2012-12-05 13:54:41 +0900 (Wed, 05 Dec 2012)

  New Revision: d9eda236a7bcb77822a5156c5bafcc958b155bc2
  https://github.com/groonga/gcs-console/commit/d9eda236a7bcb77822a5156c5bafcc958b155bc2

  Log:
    Validate endpoint format

  Modified files:
    bin/gcs-console

  Modified: bin/gcs-console (+6 -0)
===================================================================
--- bin/gcs-console    2012-12-05 12:54:15 +0900 (6af8cc4)
+++ bin/gcs-console    2012-12-05 13:54:41 +0900 (6cebb9a)
@@ -31,6 +31,12 @@ program
   .parse(process.argv);
 
 app.set('port', program.port);
+
+if (!program.endpoint.match(/^http:\/\//)) {
+  console.log('Endpoint must start with "http://". For example, http://127.0.0.1.xip.io:7575. "' + program.endpoint + '" is given.');
+  process.exit(1);
+}
+
 app.set('endpoint', program.endpoint);
 app.set('home', program.gcsConsoleHome);
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index