Fix the spore 'base_url' attribute
This commit is contained in:
parent
740cbea766
commit
a02b367a90
@ -205,7 +205,7 @@ class WSRoot(object):
|
||||
res_content_type = None
|
||||
|
||||
if request.path == self._webpath + '/api.spore':
|
||||
res.body = spore.getdesc(self)
|
||||
res.body = spore.getdesc(self, request)
|
||||
res.content_type = 'application/json'
|
||||
return res
|
||||
|
||||
|
@ -6,7 +6,7 @@ except ImportError:
|
||||
import json
|
||||
|
||||
|
||||
def getdesc(root):
|
||||
def getdesc(root, request):
|
||||
methods = {}
|
||||
|
||||
for path, funcdef in root.getapi():
|
||||
@ -33,7 +33,7 @@ def getdesc(root):
|
||||
|
||||
methods[name] = {
|
||||
'method': method,
|
||||
'path': '/'.join([root._webpath] + path)
|
||||
'path': '/'.join(path)
|
||||
}
|
||||
if required_params:
|
||||
methods[name]['required_params'] = required_params
|
||||
@ -50,7 +50,7 @@ def getdesc(root):
|
||||
formats.append('json')
|
||||
|
||||
api = {
|
||||
'base_url': root._webpath,
|
||||
'base_url': request.host_url + root._webpath,
|
||||
'version': '0.1',
|
||||
'name': getattr(root, 'name', 'name'),
|
||||
'authority': '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user