mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-11 12:28:54 +00:00
fix(gold): use GET for VNAppMob key refresh endpoint
VNAppMob /api/request_api_key returns 405 for POST and accepts GET.
This commit is contained in:
1 parent
12dc515047
commit
e0b0418173
2 files changed
+3
-3
No files matched your search
@@ -212,7 +212,7 @@ func (c *VNAppMobClient) refreshKeyLocked(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodPost, endpoint, nil)
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil)
|
||||
if err != nil {
|
||||
return fmt.Errorf("vnappmob: build refresh request: %w", err)
|
||||
}
|
||||
|
||||
@@ -100,8 +100,8 @@ func TestRefreshKey(t *testing.T) {
|
||||
exp := time.Unix(1000, 0).Add(14 * 24 * time.Hour).Unix()
|
||||
var refreshHits int32
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
t.Errorf("refresh: want POST, got %s", r.Method)
|
||||
if r.Method != http.MethodGet {
|
||||
t.Errorf("refresh: want GET, got %s", r.Method)
|
||||
}
|
||||
if !strings.HasSuffix(r.URL.Path, "/api/request_api_key") {
|
||||
t.Errorf("refresh path: got %s", r.URL.Path)
|
||||
|
||||
Reference in new issue
Block a user