Skip to content

Commit

Permalink
Fix typo getRequestId -> getRouteId
Browse files Browse the repository at this point in the history
  • Loading branch information
Héctor Hurtado committed Sep 10, 2020
1 parent 9a78bdd commit 6d24cc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/server/data/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func getRequestFileContent(w http.ResponseWriter, r *http.Request, h *model.Hand
}
}

func getRequestId(w http.ResponseWriter, r *http.Request, h *model.Handler) {
func getRouteId(w http.ResponseWriter, r *http.Request, h *model.Handler) {
w.Header().Add("Content-Type", "application/octet-stream")
_, _ = w.Write([]byte(h.Route.ID))

Expand Down
6 changes: 3 additions & 3 deletions internal/server/data/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ func TestGetRouteId200sOnHappyPath(t *testing.T) {
r := httptest.NewRequest("GET", "/not-important-here", nil)
w := httptest.NewRecorder()

getRequestId(w, r, &h)
getRouteId(w, r, &h)

res := w.Result()
if res.StatusCode != http.StatusOK {
Expand All @@ -1163,7 +1163,7 @@ func TestGetRouteIdSetsOctectStreamContentType(t *testing.T) {
r := httptest.NewRequest("GET", "/not-important-here", nil)
w := httptest.NewRecorder()

getRequestId(w, r, &h)
getRouteId(w, r, &h)

res := w.Result()
if v := res.Header.Get("Content-Type"); v != "application/octet-stream" {
Expand All @@ -1180,7 +1180,7 @@ func TestGetRouteIdReturnsTheCorrectRouteId(t *testing.T) {
r := httptest.NewRequest("GET", "/not-important-here", nil)
w := httptest.NewRecorder()

getRequestId(w, r, &h)
getRouteId(w, r, &h)

res := w.Result()
if body, _ := ioutil.ReadAll(res.Body); string(body) != h.Route.ID {
Expand Down

0 comments on commit 6d24cc4

Please sign in to comment.