Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #342 from vania-pooh/master
Browse files Browse the repository at this point in the history
Getting capability value from json wire and w3c sections
  • Loading branch information
vania-pooh authored Apr 26, 2021
2 parents fb77d33 + 781a60c commit 8be2c1d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,23 @@ func (c caps) capabilities(fn func(m map[string]interface{}, w3c bool)) {
if m, ok := desiredCapabilities.(map[string]interface{}); ok {
fn(m, false)
}
} else {
if w3cCapabilities, ok := c[keys.w3cCapabilities]; ok {
if m, ok := w3cCapabilities.(map[string]interface{}); ok {
if alwaysMatch, ok := m[keys.alwaysMatch]; ok {
if m, ok := alwaysMatch.(map[string]interface{}); ok {
fn(m, true)
for k, v := range m { // Extension capabilities have ":" in key
if ec, ok := v.(map[string]interface{}); ok && strings.Contains(k, ":") {
fn(ec, true)
}
}
if w3cCapabilities, ok := c[keys.w3cCapabilities]; ok {
if m, ok := w3cCapabilities.(map[string]interface{}); ok {
if alwaysMatch, ok := m[keys.alwaysMatch]; ok {
if m, ok := alwaysMatch.(map[string]interface{}); ok {
fn(m, true)
for k, v := range m { // Extension capabilities have ":" in key
if ec, ok := v.(map[string]interface{}); ok && strings.Contains(k, ":") {
fn(ec, true)
}
}
}
}
}
} else {
fn(make(map[string]interface{}), false)
}
fn(make(map[string]interface{}), false)
}

func (c caps) capability(k string) string {
Expand Down

0 comments on commit 8be2c1d

Please sign in to comment.