mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-26 02:09:47 +08:00
Fix lint warnings in middleware/rewrite
This commit is contained in:
parent
506f131428
commit
d0a51048d7
|
@ -6,12 +6,13 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/mholt/caddy/middleware"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/mholt/caddy/middleware"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Rewrite is middleware to rewrite request locations internally before being handled.
|
// Rewrite is middleware to rewrite request locations internally before being handled.
|
||||||
|
@ -96,7 +97,7 @@ func NewRegexpRule(base, pattern, to string, ext []string) (*RegexpRule, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// regexpVars are variables that can be used for To (rewrite destination path).
|
// regexpVars are variables that can be used for To (rewrite destination path).
|
||||||
var regexpVars []string = []string{
|
var regexpVars = []string{
|
||||||
"{path}",
|
"{path}",
|
||||||
"{query}",
|
"{query}",
|
||||||
"{file}",
|
"{file}",
|
||||||
|
|
|
@ -6,8 +6,9 @@ import (
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mholt/caddy/middleware"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/mholt/caddy/middleware"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRewrite(t *testing.T) {
|
func TestRewrite(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user