add init world data
This commit is contained in:
@@ -2,6 +2,7 @@ package requests
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
@@ -71,3 +72,16 @@ func (conf *Config) SetSessionTokenFromHeader(resp http.Header) (bool, error) {
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func (conf *Config) GetRequestHeader() *http.Header {
|
||||
header := http.Header{}
|
||||
header.Set("Cookie", fmt.Sprintf("session=%s", conf.SessionID))
|
||||
header.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
|
||||
header.Set("Connection", "keep-alive")
|
||||
header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
header.Set("Host", conf.Host)
|
||||
header.Set("Origin", fmt.Sprintf("http://%s", conf.Host))
|
||||
header.Set("Referer", fmt.Sprintf("http://%s%s", conf.Host, AuthPath))
|
||||
|
||||
return &header
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user