HTTP API: Don't loop redirecting when URL wasn't found 29/182229/2
authorMaciej Wereski <m.wereski@partner.samsung.com>
Thu, 21 Jun 2018 10:38:50 +0000 (12:38 +0200)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Wed, 27 Jun 2018 15:49:38 +0000 (17:49 +0200)
commit38b908b90578606c119cd8e51d3336b59a0947dd
treed000b2daf61bb7d01358bc67bff9a114380cfa9f
parent3303afc21a5d8a0370a65b29340b076ca01996a6
HTTP API: Don't loop redirecting when URL wasn't found

Currently when api version isn't provided in URL then request is
redirected to default one. If requested resource isn't found there then
the redirected will be served by the same handler, so it will be
redirected which results in another redirection and so on. This change
introduces new handler that responds with 404 error when page wasn't
found in default version of API.

Change-Id: I1b67f7166d3b0d92500ab2f5727c2827b485d940
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
http/server/api/api.go
http/server/api/api_test.go