feat: remove end slash in request.host_url

pull/53/head
John Wang 3 years ago
parent f1925f0d82
commit dd557c1771

@ -56,7 +56,7 @@ class App(db.Model):
@property @property
def api_base_url(self): def api_base_url(self):
return (current_app.config['API_URL'] if current_app.config['API_URL'] else request.host_url) + '/v1' return (current_app.config['API_URL'] if current_app.config['API_URL'] else request.host_url.rstrip('/')) + '/v1'
@property @property
def tenant(self): def tenant(self):
@ -505,7 +505,7 @@ class Site(db.Model):
@property @property
def app_base_url(self): def app_base_url(self):
return (current_app.config['APP_URL'] if current_app.config['APP_URL'] else request.host_url) + '/v1' return (current_app.config['APP_URL'] if current_app.config['APP_URL'] else request.host_url.rstrip('/')) + '/v1'
class ApiToken(db.Model): class ApiToken(db.Model):

@ -154,9 +154,13 @@ services:
restart: always restart: always
environment: environment:
EDITION: SELF_HOSTED EDITION: SELF_HOSTED
# The base URL of console application, refers to the Console base URL of WEB service. # The base URL of console application, refers to the Console base URL of WEB service if console domain is
# different from api or web app domain.
# example: http://cloud.dify.ai
CONSOLE_URL: '' CONSOLE_URL: ''
# The URL for Web APP, refers to the Web App base URL of WEB service. # The URL for Web APP, refers to the Web App base URL of WEB service if web app domain is different from
# console or api domain.
# example: http://udify.app
APP_URL: '' APP_URL: ''
# The postgres database. # The postgres database.

Loading…
Cancel
Save