Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ func (a *App) handleMyRequest(w http.ResponseWriter, req *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusOK)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative would be to move these prior to the Write calls, however that seems redundant.

}
```

Expand All @@ -255,7 +254,6 @@ func (a *App) handleMyRequest(w http.ResponseWriter, req *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusOK)
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ func (a *App) handleMyCustomEndpoint(w http.ResponseWriter, r *http.Request) {
// handle the request
// e.g. call a third-party API
w.Write([]byte("my custom response"))
w.WriteHeader(http.StatusOK)
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ func handleTables(w http.ResponseWriter, r *http.Request) {
// Handle errors (omited)

w.Write(body)
w.WriteHeader(http.StatusOK)
}
```

Expand Down
3 changes: 0 additions & 3 deletions docusaurus/docs/shared/implement-resource-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func (p *MyPlugin) handleNamespaces(rw http.ResponseWriter, req *http.Request) {
if err != nil {
return
}
rw.WriteHeader(http.StatusOK)
}

func (p *MyPlugin) handleProjects(rw http.ResponseWriter, req *http.Request) {
Expand All @@ -61,7 +60,6 @@ func (p *MyPlugin) handleProjects(rw http.ResponseWriter, req *http.Request) {
if err != nil {
return
}
rw.WriteHeader(http.StatusOK)
}
```

Expand All @@ -82,7 +80,6 @@ func (p *MyPlugin) handleSomeRoute(rw http.ResponseWriter, req *http.Request) {
if err != nil {
return
}
rw.WriteHeader(http.StatusOK)
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ func (a *App) handlePing(w http.ResponseWriter, req *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusOK)
}

// handleEcho is an example HTTP POST resource that accepts a JSON with a "message" key and
Expand All @@ -34,7 +33,6 @@ func (a *App) handleEcho(w http.ResponseWriter, req *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusOK)
}

// registerRoutes takes a *http.ServeMux and registers some HTTP handlers.
Expand Down