File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -172,3 +172,8 @@ func (r *Request) ParseCookies() (err os.Error) {
172
172
173
173
return nil
174
174
}
175
+
176
+ func (r * Request ) HasParam (name string ) bool {
177
+ _ , ok := r .Params [name ]
178
+ return ok
179
+ }
Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ func (ctx *Context) Abort(status int, body string) {
35
35
ctx .responseStarted = true
36
36
}
37
37
38
+ func (ctx * Context ) Redirect (status int , url string ) {
39
+ //note := "<a href=\"%v\">" + statusText[code] + "</a>.\n"
40
+
41
+ ctx .Conn .SetHeader ("Location" , url , true )
42
+ ctx .Conn .StartResponse (status )
43
+ ctx .Conn .WriteString ("" )
44
+ ctx .responseStarted = true
45
+ }
38
46
//Sets a cookie -- duration is the amount of time in seconds. 0 = forever
39
47
func (ctx * Context ) SetCookie (name string , value string , duration int64 ) {
40
48
if duration == 0 {
You can’t perform that action at this time.
0 commit comments