+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions github/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ type APIMeta struct {

// An array of SSH keys.
SSHKeys []string `json:"ssh_keys,omitempty"`

// An array of IP addresses in CIDR format specifying the addresses
// which serve GitHub websites.
Web []string `json:"web,omitempty"`

// An array of IP addresses in CIDR format specifying the addresses
// which serve GitHub APIs.
API []string `json:"api,omitempty"`
}

// APIMeta returns information about GitHub.com, the service. Or, if you access
Expand Down
10 changes: 8 additions & 2 deletions github/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ func TestAPIMeta_Marshal(t *testing.T) {
Dependabot: []string{"d"},
SSHKeyFingerprints: map[string]string{"a": "f"},
SSHKeys: []string{"k"},
API: []string{"a"},
Web: []string{"w"},
}
want := `{
"hooks":["h"],
Expand All @@ -200,7 +202,9 @@ func TestAPIMeta_Marshal(t *testing.T) {
"actions":["a"],
"dependabot":["d"],
"ssh_key_fingerprints":{"a":"f"},
"ssh_keys":["k"]
"ssh_keys":["k"],
"api":["a"],
"web":["w"]
}`

testJSONMarshal(t, a, want)
Expand All @@ -212,7 +216,7 @@ func TestAPIMeta(t *testing.T) {

mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
fmt.Fprint(w, `{"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true}`)
fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true}`)
})

ctx := context.Background()
Expand All @@ -228,6 +232,8 @@ func TestAPIMeta(t *testing.T) {
Importer: []string{"i"},
Actions: []string{"a"},
Dependabot: []string{"d"},
API: []string{"a"},
Web: []string{"w"},

VerifiablePasswordAuthentication: Bool(true),
}
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载