This is an automated email from the ASF dual-hosted git repository.
mark4z pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-go-pixiu-samples.git
The following commit(s) were added to refs/heads/main by this push:
new b11e939 [feature] cors support options request
b11e939 is described below
commit b11e939f3f7bf453829b240d6965f980c5cd50d7
Author: mark4z <[email protected]>
AuthorDate: Thu Nov 23 00:02:26 2023 +0800
[feature] cors support options request
---
http/simple/test/pixiu_test.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/http/simple/test/pixiu_test.go b/http/simple/test/pixiu_test.go
index 6dddba3..12112ed 100644
--- a/http/simple/test/pixiu_test.go
+++ b/http/simple/test/pixiu_test.go
@@ -37,7 +37,7 @@ func TestPost(t *testing.T) {
client := &http.Client{Timeout: 5 * time.Second}
req, err := http.NewRequest("POST", url, strings.NewReader(data))
assert.NoError(t, err)
- req.Host = "api.dubbo.com"
+ req.Header.Add("Origin", "api.dubbo.com")
req.Header.Add("Content-Type", "application/json")
resp, err := client.Do(req)
assert.NoError(t, err)
@@ -54,7 +54,7 @@ func TestGET1(t *testing.T) {
client := &http.Client{Timeout: 5 * time.Second}
req, err := http.NewRequest("GET", url, nil)
assert.NoError(t, err)
- req.Host = "api.dubbo.com"
+ req.Header.Add("Origin", "api.dubbo.com")
req.Header.Add("Content-Type", "application/json")
resp, err := client.Do(req)
assert.NoError(t, err)