mirror of
https://github.com/documize/community.git
synced 2025-07-20 21:59:42 +02:00
refactored getAppURL
This commit is contained in:
parent
6cc6b6d70f
commit
2e39b7a471
5 changed files with 22 additions and 26 deletions
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
|
@ -15,7 +15,6 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/documize/community/core/api/request"
|
||||
"github.com/documize/community/core/api/store"
|
||||
"github.com/documize/community/core/log"
|
||||
)
|
||||
|
@ -26,18 +25,6 @@ func init() {
|
|||
storageProvider = new(store.LocalStorageProvider)
|
||||
}
|
||||
|
||||
//getAppURL returns full HTTP url for the app
|
||||
func getAppURL(c request.Context, endpoint string) string {
|
||||
|
||||
scheme := "http://"
|
||||
|
||||
if c.SSL {
|
||||
scheme = "https://"
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s%s/%s", scheme, c.AppURL, endpoint)
|
||||
}
|
||||
|
||||
func writePayloadError(w http.ResponseWriter, method string, err error) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue