# HG changeset patch # User casties # Date 1418398078 -3600 # Node ID bc68ca0d2c0a904ac8581c8e976ac313b1e19e15 # Parent a7b287122ce8c8f13413a42d08eb868de863a2ac make annotationServerUrl work with protocol-relative URL (//). diff -r a7b287122ce8 -r bc68ca0d2c0a SrvTxtUtils.py --- a/SrvTxtUtils.py Thu Dec 11 17:24:21 2014 +0100 +++ b/SrvTxtUtils.py Fri Dec 12 16:27:58 2014 +0100 @@ -280,6 +280,8 @@ for cnt in range(num_tries): try: logging.debug("getHttp(lib2)Data(#%s %ss) url=%s"%(cnt+1,timeout,url)) + # I would prefer at least disable_ssl_certificate_validation=insecure + # but python < 2.7.9 doesn't do SNI :-( h = httplib2.Http(cache=cache, timeout=float(timeout), disable_ssl_certificate_validation=True) if username: h.add_credentials(username, password) diff -r a7b287122ce8 -r bc68ca0d2c0a documentViewer.py --- a/documentViewer.py Thu Dec 11 17:24:21 2014 +0100 +++ b/documentViewer.py Fri Dec 12 16:27:58 2014 +0100 @@ -1161,6 +1161,15 @@ def getAnnotatorGroupsForUser(self, user, annotationServerUrl="http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager"): """returns list of groups {name:*, id:*} on the annotation server for the user""" groups = [] + if annotationServerUrl.startswith('//'): + # add matching http(s) from our URL + myUrl = self.REQUEST['URL'] + logging.debug("my URL: %s"%myUrl) + if myUrl.startswith('https:'): + annotationServerUrl = "https:%s"%annotationServerUrl + else: + annotationServerUrl = "http:%s"%annotationServerUrl + groupsUrl = "%s/annotator/groups?user=%s"%(annotationServerUrl,user) data = getHttpData(url=groupsUrl, noExceptions=True) if data: diff -r a7b287122ce8 -r bc68ca0d2c0a zpt/viewer/layer_text_annotator.zpt --- a/zpt/viewer/layer_text_annotator.zpt Thu Dec 11 17:24:21 2014 +0100 +++ b/zpt/viewer/layer_text_annotator.zpt Fri Dec 12 16:27:58 2014 +0100 @@ -27,7 +27,7 @@