mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb: hide debug prints
This commit is contained in:
@@ -134,7 +134,6 @@ pub fn (mut ctx Context) set_cookie(cookie Cookie) {
|
|||||||
|
|
||||||
pub fn (mut ctx Context) set_cookie_old(key, val string) {
|
pub fn (mut ctx Context) set_cookie_old(key, val string) {
|
||||||
// TODO support directives, escape cookie value (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie)
|
// TODO support directives, escape cookie value (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie)
|
||||||
//println('Set-Cookie $key=$val')
|
|
||||||
//ctx.add_header('Set-Cookie', '${key}=${val}; Secure; HttpOnly')
|
//ctx.add_header('Set-Cookie', '${key}=${val}; Secure; HttpOnly')
|
||||||
ctx.add_header('Set-Cookie', '${key}=${val}; HttpOnly')
|
ctx.add_header('Set-Cookie', '${key}=${val}; HttpOnly')
|
||||||
}
|
}
|
||||||
@@ -344,7 +343,9 @@ fn handle_conn<T>(conn net.Socket, mut app T) {
|
|||||||
app.init()
|
app.init()
|
||||||
|
|
||||||
// Call the right action
|
// Call the right action
|
||||||
|
$if debug {
|
||||||
println('route matching...')
|
println('route matching...')
|
||||||
|
}
|
||||||
//t := time.ticks()
|
//t := time.ticks()
|
||||||
//mut action := ''
|
//mut action := ''
|
||||||
mut route_words_a := [][]string{}
|
mut route_words_a := [][]string{}
|
||||||
@@ -379,7 +380,9 @@ fn handle_conn<T>(conn net.Socket, mut app T) {
|
|||||||
// For example URL `/register` matches route `/:user`, but `fn register()`
|
// For example URL `/register` matches route `/:user`, but `fn register()`
|
||||||
// should be called first.
|
// should be called first.
|
||||||
if (req.method == .get && url_words[0] == method.name && url_words.len == 1) || (req.method == .post && url_words[0] + '_post' == method.name) {
|
if (req.method == .get && url_words[0] == method.name && url_words.len == 1) || (req.method == .post && url_words[0] + '_post' == method.name) {
|
||||||
|
$if debug {
|
||||||
println('easy match method=$method.name')
|
println('easy match method=$method.name')
|
||||||
|
}
|
||||||
app.$method(vars)
|
app.$method(vars)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user