mirror of
https://github.com/nkanaev/yarr.git
synced 2025-09-14 02:10:04 +00:00
don't serve templates
This commit is contained in:
@@ -31,3 +31,15 @@ func TestStaticWithBase(t *testing.T) {
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
func TestStaticBanTemplates(t *testing.T) {
|
||||
handler := NewServer(nil, "127.0.0.1:8000").handler()
|
||||
url := "/static/login.html"
|
||||
|
||||
recorder := httptest.NewRecorder()
|
||||
request := httptest.NewRequest("GET", url, nil)
|
||||
handler.ServeHTTP(recorder, request)
|
||||
if recorder.Result().StatusCode != 404 {
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user