Browse Source

Change Url to URL.

Coda Hale 12 years ago
parent
commit
215a04397b
2 changed files with 7 additions and 7 deletions
  1. +6
    -6
      web/pattern.go
  2. +1
    -1
      web/web.go

+ 6
- 6
web/pattern.go View File

@ -29,11 +29,11 @@ func (p regexpPattern) Match(r *http.Request, c *C, dryrun bool) bool {
return true return true
} }
if c.UrlParams == nil {
c.UrlParams = make(map[string]string, len(matches)-1)
if c.URLParams == nil {
c.URLParams = make(map[string]string, len(matches)-1)
} }
for i := 1; i < len(matches); i++ { for i := 1; i < len(matches); i++ {
c.UrlParams[p.names[i]] = matches[i]
c.URLParams[p.names[i]] = matches[i]
} }
return true return true
} }
@ -185,11 +185,11 @@ func (s stringPattern) Match(r *http.Request, c *C, dryrun bool) bool {
return true return true
} }
if c.UrlParams == nil && len(matches) > 0 {
c.UrlParams = make(map[string]string, len(matches)-1)
if c.URLParams == nil && len(matches) > 0 {
c.URLParams = make(map[string]string, len(matches)-1)
} }
for i, match := range matches { for i, match := range matches {
c.UrlParams[s.pats[i]] = match
c.URLParams[s.pats[i]] = match
} }
return true return true
} }


+ 1
- 1
web/web.go View File

@ -93,7 +93,7 @@ type C struct {
// strings that matched those identifiers, but if a unnamed regex // strings that matched those identifiers, but if a unnamed regex
// capture is used, it will be assigned to the special identifiers "$1", // capture is used, it will be assigned to the special identifiers "$1",
// "$2", etc. // "$2", etc.
UrlParams map[string]string
URLParams map[string]string
// A free-form environment, similar to Rack or PEP 333's environments. // A free-form environment, similar to Rack or PEP 333's environments.
// Middleware layers are encouraged to pass data to downstream layers // Middleware layers are encouraged to pass data to downstream layers
// and other handlers using this map, and are even more strongly // and other handlers using this map, and are even more strongly


Loading…
Cancel
Save