vweb: hide debug prints

pull/6280/head
Sandro Martini 2020-08-31 19:39:46 +02:00 committed by GitHub
parent cbcba2e4cf
commit 39da5eca89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -134,7 +134,6 @@ pub fn (mut ctx Context) set_cookie(cookie Cookie) {
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)
//println('Set-Cookie $key=$val')
//ctx.add_header('Set-Cookie', '${key}=${val}; Secure; 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()
// Call the right action
println('route matching...')
$if debug {
println('route matching...')
}
//t := time.ticks()
//mut action := ''
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()`
// 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) {
println('easy match method=$method.name')
$if debug {
println('easy match method=$method.name')
}
app.$method(vars)
return
}