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

Commit

Permalink
Getting capability value from json wire and w3c sections
Browse files Browse the repository at this point in the history
  • Loading branch information
vania-pooh committed Apr 26, 2021
1 parent fb77d33 commit 781a60c
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 781a60c

Please sign in to comment.