Skip to content

Commit 42c9637

Browse files
authored
Merge pull request revel#1218 from notzippy/docs
Some small bug fixes / improvements
2 parents f5c9db9 + c57df47 commit 42c9637

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Revel Framework
22

3-
[![Build Status](https://secure.travis-ci.org/revel/revel.svg?branch=master)](http://travis-ci.org/revel/revel) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
3+
[![Build Status](https://secure.travis-ci.org/revel/revel.svg?branch=master)](http://travis-ci.org/revel/revel)
4+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
5+
[![Go Report Card](https://goreportcard.com/badge/github.com/revel/revel)](https://goreportcard.com/report/github.com/revel/revel)
46

57
A high productivity, full-stack web framework for the [Go language](http://www.golang.org).
68

http.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type Request struct {
3131
Method string
3232
RemoteAddr string
3333
Host string
34-
// DEPRECATED use request methods
34+
// URL request path from the server (built)
3535
URL *url.URL
3636
// DEPRECATED use GetForm()
3737
Form url.Values
@@ -80,7 +80,7 @@ func (req *Request) SetRequest(r ServerRequest) {
8080
req.ServerHeader.Server = h.(ServerHeader)
8181
}
8282

83-
req.URL, _ = url.Parse(req.GetRequestURI())
83+
req.URL,_ = req.GetValue(HTTP_URL).(*url.URL)
8484
req.ContentType = ResolveContentType(req)
8585
req.Format = ResolveFormat(req)
8686
req.AcceptLanguages = ResolveAcceptLanguage(req)

router.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,11 @@ func splitActionPath(actionPathData *ActionPathData, actionPath string, useCache
354354
}
355355
action = actionSplit[1]
356356
} else {
357-
WARN.Printf("Invalid action path %s ", actionPath)
357+
foundPaths := ""
358+
for path:=range actionPathCacheMap {
359+
foundPaths += path +","
360+
}
361+
WARN.Printf("Invalid action path %s found paths %s", actionPath, foundPaths)
358362
found = false
359363
}
360364

@@ -671,8 +675,10 @@ func (router *Router) Reverse(action string, argValues map[string]string) (ad *A
671675
if el == "" || (el[0] != ':' && el[0] != '*') {
672676
continue
673677
}
674-
675-
val, ok := argValues[el[1:]]
678+
val, ok := pathData.FixedParamsByName[el[1:]]
679+
if !ok {
680+
val, ok = argValues[el[1:]]
681+
}
676682
if !ok {
677683
val = "<nil>"
678684
ERROR.Print("revel/router: reverse route missing route arg ", el[1:])

server-engine.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const (
3333
HTTP_REQUEST_URI = iota + 1000
3434
HTTP_REMOTE_ADDR = iota + 1000
3535
HTTP_HOST = iota + 1000
36+
HTTP_URL = iota + 1000
3637
HTTP_SERVER_HEADER = iota + 1000
3738
HTTP_STREAM_WRITER = iota + 1000
3839
HTTP_WRITER = ENGINE_WRITER

server_adapter_go.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ func (r *GoRequest) Get(key int) (value interface{}, err error) {
211211
value = r.Original.URL.Path
212212
case HTTP_HOST:
213213
value = r.Original.Host
214+
case HTTP_URL:
215+
value = r.Original.URL
214216
case HTTP_BODY:
215217
value = r.Original.Body
216218
default:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy