Check for users path

merge-requests/30/head
Bob Mottram 2021-09-12 17:04:45 +01:00
parent d071081b3a
commit 41c6d2e286
2 changed files with 14 additions and 7 deletions

View File

@ -6481,7 +6481,10 @@ class PubServer(BaseHTTPRequestHandler):
"""Returns an ontology file
"""
if '.owl' in path or '.rdf' in path or '.json' in path:
ontologyStr = path.split('/ontologies/')[1].replace('#', '')
if '/ontologies/' in path:
ontologyStr = path.split('/ontologies/')[1].replace('#', '')
else:
ontologyStr = path.split('/data/')[1].replace('#', '')
ontologyFilename = None
ontologyFileType = 'application/rdf+xml'
if ontologyStr.startswith('DFC_'):
@ -10908,6 +10911,7 @@ class PubServer(BaseHTTPRequestHandler):
divertToLoginScreen = False
if '/media/' not in path and \
'/ontologies/' not in path and \
'/data/' not in path and \
'/sharefiles/' not in path and \
'/statuses/' not in path and \
'/emoji/' not in path and \
@ -13035,11 +13039,13 @@ class PubServer(BaseHTTPRequestHandler):
GETstartTime, GETtimings)
return
if '/ontologies/' in self.path:
self._getOntology(callingDomain,
self.path, self.server.baseDir,
GETstartTime, GETtimings)
return
if '/ontologies/' in self.path or \
'/data/' in self.path:
if not hasUsersPath(self.path):
self._getOntology(callingDomain,
self.path, self.server.baseDir,
GETstartTime, GETtimings)
return
self._benchmarkGETtimings(GETstartTime, GETtimings,
'show emoji done',

View File

@ -1790,7 +1790,8 @@ def _getReservedWords() -> str:
'ignores', 'linksmobile', 'newswiremobile',
'minimal', 'search', 'eventdelete',
'searchemoji', 'catalog', 'conversationId',
'mention', 'http', 'https')
'mention', 'http', 'https',
'ontologies', 'data')
def getNicknameValidationPattern() -> str: