Permalink
Browse files

Quick fix for possible to large HTTPPostContentType data

  • Loading branch information...
1 parent 291ee8d commit 2cd9791a842a9d7ff191a59a692d52c303fcc12a @gizmocuz gizmocuz committed Jan 11, 2017
Showing with 24 additions and 3 deletions.
  1. +13 −1 main/SQLHelper.cpp
  2. +10 −1 www/app/SetupController.js
  3. +1 −1 www/html5.appcache
View
@@ -33,7 +33,7 @@
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
-#define DB_VERSION 107
+#define DB_VERSION 108
extern http::server::CWebServerHelper m_webservers;
extern std::string szWWWFolder;
@@ -2101,6 +2101,18 @@ bool CSQLHelper::OpenDatabase()
query("ALTER TABLE LightingLog ADD COLUMN [User] VARCHAR(100) DEFAULT ('')");
}
}
+ if (dbversion < 108)
+ {
+ //Fix possible HTTP notifier problem
+ std::string sValue;
+ GetPreferencesVar("HTTPPostContentType", sValue);
+ if ((sValue.size()>100)||(sValue.empty()))
+ {
+ sValue = "application/json";
+ std::string sencoded = base64_encode((const unsigned char*)sValue.c_str(), sValue.size());
+ UpdatePreferencesVar("HTTPPostContentType", sencoded);
+ }
+ }
}
else if (bNewInstall)
{
@@ -61,7 +61,16 @@ define(['app'], function (app) {
ShowNotify($.t('Please specify the base URL!...'), 3500, true);
return;
}
- extraparams = "HTTPField1=" + HTTPField1 + "&HTTPField2=" + HTTPField2 + "&HTTPField3=" + HTTPField3 + "&HTTPField4=" + HTTPField4 + "&HTTPTo=" + HTTPTo + "&HTTPURL=" + HTTPURL + "&HTTPPostData=" + HTTPPostData + "&HTTPPostContentType=" + HTTPPostContentType + "&HTTPPostHeaders=" + HTTPPostHeaders;
+ extraparams =
+ "HTTPField1=" + HTTPField1 +
+ "&HTTPField2=" + HTTPField2 +
+ "&HTTPField3=" + HTTPField3 +
+ "&HTTPField4=" + HTTPField4 +
+ "&HTTPTo=" + HTTPTo +
+ "&HTTPURL=" + HTTPURL +
+ "&HTTPPostData=" + HTTPPostData +
+ "&HTTPPostContentType=" + HTTPPostContentType +
+ "&HTTPPostHeaders=" + HTTPPostHeaders;
break;
case "prowl":
var ProwlAPI=encodeURIComponent($("#prowltable #ProwlAPI").val());
View
@@ -1,5 +1,5 @@
CACHE MANIFEST
-# ref 1330
+# ref 1331
CACHE:
# CSS

0 comments on commit 2cd9791

Please sign in to comment.