def METHOD_NAME(self):
    assert self.is_http
    m = re.match(re.escape(MDS_URI_PREFIX) + r'(.*?)($|#)', self.uri)
    if m:
        return m.group(1)
    raise AssertionError("Failed to extract mds key properly from '{}'".format(self.uri))