View definition

func NewVHostPathRewriter

Defined in github.com/valyala/fasthttp/fs.go

Description

NewVHostPathRewriter returns path rewriter, which strips slashesCount leading slashes from the path and prepends the path with request's host, thus simplifying virtual hosting for static files.

Examples:

* host=foobar.com, slashesCount=0, original path="/foo/bar".
  Resulting path: "/foobar.com/foo/bar"

* host=img.aaa.com, slashesCount=1, original path="/images/123/456.jpg"
  Resulting path: "/img.aaa.com/123/456.jpg"

NewVHostPathRewriter is referenced in 1 repository

github.com/valyala/fasthttp