Changeset 622:bc68ca0d2c0a in documentViewer


Ignore:
Timestamp:
Dec 12, 2014, 3:27:58 PM (9 years ago)
Author:
casties
Branch:
default
Message:

make annotationServerUrl work with protocol-relative URL ().

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • SrvTxtUtils.py

    r621 r622  
    281281            try:
    282282                logging.debug("getHttp(lib2)Data(#%s %ss) url=%s"%(cnt+1,timeout,url))
     283                # I would prefer at least disable_ssl_certificate_validation=insecure
     284                # but python < 2.7.9 doesn't do SNI :-(
    283285                h = httplib2.Http(cache=cache, timeout=float(timeout), disable_ssl_certificate_validation=True)
    284286                if username:
  • documentViewer.py

    r618 r622  
    11621162        """returns list of groups {name:*, id:*} on the annotation server for the user"""
    11631163        groups = []
     1164        if annotationServerUrl.startswith('//'):
     1165            # add matching http(s) from our URL
     1166            myUrl = self.REQUEST['URL']
     1167            logging.debug("my URL: %s"%myUrl)
     1168            if myUrl.startswith('https:'):
     1169                annotationServerUrl = "https:%s"%annotationServerUrl
     1170            else:
     1171                annotationServerUrl = "http:%s"%annotationServerUrl
     1172           
    11641173        groupsUrl = "%s/annotator/groups?user=%s"%(annotationServerUrl,user)
    11651174        data = getHttpData(url=groupsUrl, noExceptions=True)
  • zpt/viewer/layer_text_annotator.zpt

    r620 r622  
    2828
    2929  <script type="text/javascript"
    30     tal:define="global annServerUrl string:https://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager;
     30    tal:define="global annServerUrl string://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager;
    3131    annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']);
    3232    resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']);
Note: See TracChangeset for help on using the changeset viewer.