1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb: remove favicon hack

This commit is contained in:
Alexander Medvednikov
2019-08-02 10:15:18 +00:00
parent 8990eb06ec
commit ed3f1d315b

View File

@@ -120,15 +120,10 @@ pub fn run<T>(port int) {
first_line := s.all_before('\n') first_line := s.all_before('\n')
vals := first_line.split(' ') vals := first_line.split(' ')
mut action := vals[1].right(1).all_before('/') mut action := vals[1].right(1).all_before('/')
println('vweb.v: action="$action"')
if action.contains('?') { if action.contains('?') {
action = action.all_before('?') action = action.all_before('?')
} }
if action == 'favicon.ico' {
println('favicon.ico')
conn.write('HTTP/1.1 404 Not Found')
conn.close()
continue
}
if action == '' { if action == '' {
action = 'index' action = 'index'
} }
@@ -170,7 +165,7 @@ pub fn run<T>(port int) {
conn.write('HTTP/1.1 404 Not Found conn.write('HTTP/1.1 404 Not Found
Content-Type: text/plain Content-Type: text/plain
404 not found 404 not found
') ')
} }
conn.close() conn.close()