[Groonga-commit] groonga/gcs [master] Detect XML without XML declaration correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Nov 15 10:46:27 JST 2012


YUKI Hiroshi	2012-11-15 10:46:27 +0900 (Thu, 15 Nov 2012)

  New Revision: fecb7b48ea630505f58c5294c02744a0fdbfe533
  https://github.com/groonga/gcs/commit/fecb7b48ea630505f58c5294c02744a0fdbfe533

  Log:
    Detect XML without XML declaration correctly

  Modified files:
    tools/scenario-runner.js

  Modified: tools/scenario-runner.js (+1 -1)
===================================================================
--- tools/scenario-runner.js    2012-11-15 10:29:10 +0900 (822dd81)
+++ tools/scenario-runner.js    2012-11-15 10:46:27 +0900 (0295512)
@@ -161,7 +161,7 @@ function Response(source) {
 Response.prototype = {
   get body() {
     if (!this._body) {
-      if (this.rawBody.indexOf('<?xml') == 0) {
+      if (/^\s*</.test(this.rawBody)) {
         this._body = this._XMLStringToJSON(this.rawBody);
       } else {
         try {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index