mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-10 09:32:13 +01:00
feat(api): add debug route
This commit is contained in:
@@ -786,6 +786,7 @@ func TestApi_Start(t *testing.T) {
|
||||
mod.basicAuthUsername = "foo"
|
||||
mod.basicAuthPassword = "bar"
|
||||
mod.disableHealthCheckLogging = true
|
||||
mod.enableDebugRoute = true
|
||||
mod.routes = []Route{
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
@@ -908,6 +909,15 @@ func TestApi_Start(t *testing.T) {
|
||||
t.Errorf("expected %d status code but got %d", http.StatusOK, recorder.Code)
|
||||
}
|
||||
|
||||
// debug request.
|
||||
recorder = httptest.NewRecorder()
|
||||
debugRequest := httptest.NewRequest(http.MethodGet, "/debug", nil)
|
||||
debugRequest.SetBasicAuth(mod.basicAuthUsername, mod.basicAuthPassword)
|
||||
mod.srv.ServeHTTP(recorder, debugRequest)
|
||||
if recorder.Code != http.StatusOK {
|
||||
t.Errorf("expected %d status code but got %d", http.StatusOK, recorder.Code)
|
||||
}
|
||||
|
||||
// "multipart/form-data" request.
|
||||
multipartRequest := func(url string) *http.Request {
|
||||
body := &bytes.Buffer{}
|
||||
|
||||
Reference in New Issue
Block a user