Skip to content

veb.StaticHandler and ctx.file() don't function properly on termux #23596

@heyimtcn

Description

@heyimtcn

Describe the bug

if you host a static file or return ctx.file() on a veb server and try to access it, the request gets stuck loading forever

Reproduction Steps

import veb

pub struct App {}

pub struct Context {
	veb.Context
}

pub fn (_ &App) index(mut ctx Context) veb.Result {
	return ctx.file('file.txt')
}

fn main() {
	mut app := &App{}
	veb.run[App,Context](mut app,8080)
}
import veb

pub struct App {
	veb.StaticHandler
}

pub struct Context {
	veb.Context
}

fn main() {
	mut app := &App{}
	app.serve_static('/','file.txt')!
	veb.run[App,Context](mut app,8080)
}

run both then attempt to open localhost:8080

Expected Behavior

the file to show

Current Behavior

endless loading

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.9 3343fb7

Environment details (OS name and version, etc.)

vdoctor.v won't compile

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.Unit: vebBugs/feature requests, that are related to the `veb`, V's official web framework.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions