Spaces:
Configuration error
Configuration error
BOHE
commited on
Commit
·
640c0cb
1
Parent(s):
0c2a71c
测试
Browse files- api/main.go +2 -2
api/main.go
CHANGED
|
@@ -610,7 +610,7 @@ func handleStreamingResponse(w http.ResponseWriter, youReq *http.Request) {
|
|
| 610 |
// 获取上传文件所需的 nonce
|
| 611 |
func getNonce(dsToken string) (*NonceResponse, error) {
|
| 612 |
req, _ := http.NewRequest("GET", "https://you.com/api/get_nonce", nil)
|
| 613 |
-
req.Header.Set("Cookie", fmt.Sprintf("
|
| 614 |
|
| 615 |
resp, err := http.DefaultClient.Do(req)
|
| 616 |
if err != nil {
|
|
@@ -647,7 +647,7 @@ func uploadFile(dsToken, filePath string) (*UploadResponse, error) {
|
|
| 647 |
|
| 648 |
req, _ := http.NewRequest("POST", "https://you.com/api/upload", body)
|
| 649 |
req.Header.Set("Content-Type", writer.FormDataContentType())
|
| 650 |
-
req.Header.Set("Cookie", fmt.Sprintf("
|
| 651 |
|
| 652 |
resp, err := http.DefaultClient.Do(req)
|
| 653 |
if err != nil {
|
|
|
|
| 610 |
// 获取上传文件所需的 nonce
|
| 611 |
func getNonce(dsToken string) (*NonceResponse, error) {
|
| 612 |
req, _ := http.NewRequest("GET", "https://you.com/api/get_nonce", nil)
|
| 613 |
+
req.Header.Set("Cookie", fmt.Sprintf("DS=%s", dsToken))
|
| 614 |
|
| 615 |
resp, err := http.DefaultClient.Do(req)
|
| 616 |
if err != nil {
|
|
|
|
| 647 |
|
| 648 |
req, _ := http.NewRequest("POST", "https://you.com/api/upload", body)
|
| 649 |
req.Header.Set("Content-Type", writer.FormDataContentType())
|
| 650 |
+
req.Header.Set("Cookie", fmt.Sprintf("DS=%s", dsToken))
|
| 651 |
|
| 652 |
resp, err := http.DefaultClient.Do(req)
|
| 653 |
if err != nil {
|