2020-12-26 09:05

Restful routes

This PR is regarding issue https://github.com/tektoncd/dashboard/issues/18:

Changes: - writeResponseLocation function that sets the StatusCode to 201 and sets the "Content-Location" header appropriately (to be used within POST routes) - New test routes_test.go/TestContentLocation201 ensures that all POST routes MUST have a matching GET route and validates the 201 StatusCode and the resource that is identified within the "Content-Location" header. - New test routes_test.go/TestPut204 ensures PUT routes return 204 - Consolidate secretToCredential function that was implemented twice between credentials/credentials_test.go - Modify {id} within route to {name} for credentials to align with other endpoints (and necessary credentials changes to allow for this) - Modified routes to remove trailing slashes (new test ensures this best practice is maintained) - Removed Consumes/Produces calls on /health endpoint - Small cleanups - Updated DEVELOPMENT.md


  • 点赞
  • 回答
  • 收藏
  • 复制链接分享