Deploy Bots API #28
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -406,7 +407,19 @@ func (h *TimesHandler) GetDownloadUrl(ctx *gin.Context) {
|
||||
|
||||
// fetch download url from storage service
|
||||
// Build the full URL.
|
||||
fullURL := h.url + botData.FileID
|
||||
fullURL, err := url.JoinPath(h.url, botData.FileID)
|
||||
if err != nil {
|
||||
statusCode := http.StatusInternalServerError
|
||||
errorMessage := "Error joining Url"
|
||||
|
||||
ctx.JSON(statusCode, dto.Error{
|
||||
Error: errorMessage,
|
||||
})
|
||||
log.WithError(err).Error(
|
||||
"Error joining Url",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// Create the request with the supplied context so callers can cancel it.
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, fullURL, nil)
|
||||
|
||||
Reference in New Issue
Block a user