mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
fix
This commit is contained in:
parent
f895497b12
commit
06b2bb8709
3 changed files with 7 additions and 7 deletions
|
@ -4206,7 +4206,7 @@ fn (mut g Gen) selector_expr(node ast.SelectorExpr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
unwrapped_expr_type := g.unwrap_generic(node.expr_type)
|
unwrapped_expr_type := g.unwrap_generic(node.expr_type)
|
||||||
sym := g.table.sym(unwrapped_expr_type)
|
sym := g.table.final_sym(unwrapped_expr_type)
|
||||||
field_name := if sym.language == .v { c_name(node.field_name) } else { node.field_name }
|
field_name := if sym.language == .v { c_name(node.field_name) } else { node.field_name }
|
||||||
is_as_cast := node.expr is ast.AsCast
|
is_as_cast := node.expr is ast.AsCast
|
||||||
if is_as_cast {
|
if is_as_cast {
|
||||||
|
|
|
@ -75,7 +75,7 @@ fn check_duplicate_routes_in_controllers[T](global_app &T, routes map[string]Rou
|
||||||
mut controllers_sorted := []&ControllerPath{}
|
mut controllers_sorted := []&ControllerPath{}
|
||||||
$if T is ControllerInterface {
|
$if T is ControllerInterface {
|
||||||
mut paths := []string{}
|
mut paths := []string{}
|
||||||
controllers_sorted = ControllerInterface(global_app).controllers.clone()
|
controllers_sorted = global_app.controllers.clone()
|
||||||
controllers_sorted.sort(a.path.len > b.path.len)
|
controllers_sorted.sort(a.path.len > b.path.len)
|
||||||
for controller in controllers_sorted {
|
for controller in controllers_sorted {
|
||||||
if controller.host == '' {
|
if controller.host == '' {
|
||||||
|
|
|
@ -865,19 +865,19 @@ fn serve_if_static[A, X](app &A, mut user_context X, url urllib.URL, host string
|
||||||
}
|
}
|
||||||
|
|
||||||
if asked_path.ends_with('/') {
|
if asked_path.ends_with('/') {
|
||||||
if StaticApp(app).static_files[asked_path + 'index.html'] != '' {
|
if app.static_files[asked_path + 'index.html'] != '' {
|
||||||
asked_path += 'index.html'
|
asked_path += 'index.html'
|
||||||
} else if StaticApp(app).static_files[asked_path + 'index.htm'] != '' {
|
} else if app.static_files[asked_path + 'index.htm'] != '' {
|
||||||
asked_path += 'index.htm'
|
asked_path += 'index.htm'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static_file := StaticApp(app).static_files[asked_path] or { return false }
|
static_file := app.static_files[asked_path] or { return false }
|
||||||
|
|
||||||
// StaticHandler ensures that the mime type exists on either the App or in veb
|
// StaticHandler ensures that the mime type exists on either the App or in veb
|
||||||
ext := os.file_ext(static_file).to_lower()
|
ext := os.file_ext(static_file).to_lower()
|
||||||
mut mime_type := StaticApp(app).static_mime_types[ext] or { mime_types[ext] }
|
mut mime_type := app.static_mime_types[ext] or { mime_types[ext] }
|
||||||
|
|
||||||
static_host := StaticApp(app).static_hosts[asked_path] or { '' }
|
static_host := app.static_hosts[asked_path] or { '' }
|
||||||
if static_file == '' || mime_type == '' {
|
if static_file == '' || mime_type == '' {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue