Changeset 622:bc68ca0d2c0a in documentViewer for documentViewer.py


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

make annotationServerUrl work with protocol-relative URL ().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)
Note: See TracChangeset for help on using the changeset viewer.