Browse Source

Changed opg image path to rel path

Toby Chui 3 years ago
parent
commit
4e50d057f6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      mod/share/share.go

+ 2 - 2
mod/share/share.go

@@ -114,7 +114,7 @@ func (s *Manager) HandleOPGServing(w http.ResponseWriter, r *http.Request, share
 	fs := filesystem.GetFileSize(shareEntry.FileRealPath)
 	shareMeta := filepath.Ext(shareEntry.FileRealPath) + " / " + filesystem.GetFileDisplaySize(fs, 2)
 
-	if len([]rune(filename)) > 26 {
+	if len([]rune(filename)) > 20 {
 		//Split into lines
 		lines := []string{}
 		for i := 0; i < len([]rune(filenameOnly)); i += 20 {
@@ -641,7 +641,7 @@ func (s *Manager) HandleShareAccess(w http.ResponseWriter, r *http.Request) {
 					"downloadurl": "../../share/download/" + id + "/" + filepath.Base(shareOption.FileRealPath),
 					"preview_url": "/share/preview/" + id + "/",
 					"filename":    filepath.Base(shareOption.FileRealPath),
-					"opg_image":   "//" + r.Host + "/share/opg/" + strconv.Itoa(int(time.Now().Unix())) + "/" + id,
+					"opg_image":   "/share/opg/" + strconv.Itoa(int(time.Now().Unix())) + "/" + id,
 					"reqtime":     strconv.Itoa(int(time.Now().Unix())),
 				})