From 08cdd1dc4ea38c5e337dcd7dbb1e3fd63e23a7ae Mon Sep 17 00:00:00 2001 From: Jonathan Barrow Date: Tue, 5 Oct 2021 09:19:51 -0400 Subject: [PATCH] upload URL moved to env variable --- prepare_attach_file.go | 3 ++- prepare_post_object.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/prepare_attach_file.go b/prepare_attach_file.go index 46b0622..3fcda84 100644 --- a/prepare_attach_file.go +++ b/prepare_attach_file.go @@ -5,6 +5,7 @@ import ( "crypto/sha256" "encoding/hex" "fmt" + "os" "strconv" "time" @@ -58,7 +59,7 @@ func prepareAttachFile(err error, client *nex.Client, callID uint32, dataStoreAt pReqPostInfo := nexproto.NewDataStoreReqPostInfo() pReqPostInfo.DataID = dataStoreAttachFileParam.ReferDataID - pReqPostInfo.URL = "http://datastore.pretendo.cc/upload" + pReqPostInfo.URL = os.Getenv("DATASTORE_UPLOAD_URL") pReqPostInfo.RequestHeaders = []*nexproto.DataStoreKeyValue{} pReqPostInfo.FormFields = []*nexproto.DataStoreKeyValue{fieldBucket, fieldKey, fieldACL, fieldContentType, fieldPID, fieldDate, fieldSignature} pReqPostInfo.RootCACert = []byte{} diff --git a/prepare_post_object.go b/prepare_post_object.go index 192cb07..5875537 100644 --- a/prepare_post_object.go +++ b/prepare_post_object.go @@ -6,6 +6,7 @@ import ( "encoding/hex" "fmt" "math/rand" + "os" "strconv" "time" @@ -77,7 +78,7 @@ func preparePostObject(err error, client *nex.Client, callID uint32, param *nexp pReqPostInfo := nexproto.NewDataStoreReqPostInfo() pReqPostInfo.DataID = dataID - pReqPostInfo.URL = "http://datastore.pretendo.cc/upload" + pReqPostInfo.URL = os.Getenv("DATASTORE_UPLOAD_URL") pReqPostInfo.RequestHeaders = []*nexproto.DataStoreKeyValue{} pReqPostInfo.FormFields = []*nexproto.DataStoreKeyValue{fieldBucket, fieldKey, fieldACL, fieldPID, fieldDate, fieldSignature} pReqPostInfo.RootCACert = []byte{}