You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2016/02/18 14:09:01 UTC
svn commit: r1731065 -
/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js
Author: degenaro
Date: Thu Feb 18 13:09:01 2016
New Revision: 1731065
URL: http://svn.apache.org/viewvc?rev=1731065&view=rev
Log:
UIMA-4762 DUCC Web Server (WS) handle ducc.js error "pair[1] is undefined" in ducc_transform_all_cookies.
Modified:
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js?rev=1731065&r1=1731064&r2=1731065&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js Thu Feb 18 13:09:01 2016
@@ -2619,16 +2619,25 @@ function ducc_transform_all_cookies() {
var pairs = document.cookie.split(";");
var cookies = {};
for (var i=0; i<pairs.length; i++){
- var pair = pairs[i].split("=");
- var name = pair[0].trim();
- if(name.startsWith("ducc:")) {
- var value = pair[1].trim();
- var nameSuffix = name.substring(5);
- var nameModern = "DUCC"+nameSuffix;
- // delete bad cookie
- document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
- // create good cookie
- ducc_put_cookie(nameModern, value);
+ var nvp = pairs[i].split("=");
+ if(nvp.length == 2) {
+ var name = nvp[0].trim();
+ var value = nvp[1].trim();
+ if(name.startsWith("ducc:")) {
+ var nameSuffix = name.substring(5);
+ var nameModern = "DUCC"+nameSuffix;
+ // delete bad cookie
+ document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
+ // create good cookie
+ ducc_put_cookie(nameModern, value);
+ }
+ }
+ else if(nvp.length == 1) {
+ var name = nvp[0].trim();
+ if(name.startsWith("ducc:")) {
+ // delete bad cookie
+ document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
+ }
}
}
} catch (err) {