fix: date fixes; go middleware refactors; regex fixes; etc (#368)
fix: format of date when MR was closed or merged (#367) refactor: Add Payload Validators + Middleware In Go Code (#366) fix: Add better checks for leaving comments (#369) fix: regex support for http credentials embedded in remote url (#372) fix: Comment on single line selects two lines (#371) This is a #PATCH release.
This commit is contained in:
committed by
GitHub
parent
f1faf603b0
commit
22bfd0c83e
@@ -21,13 +21,7 @@ type meService struct {
|
||||
client MeGetter
|
||||
}
|
||||
|
||||
func (a meService) handler(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
if r.Method != http.MethodGet {
|
||||
w.Header().Set("Access-Control-Allow-Methods", http.MethodGet)
|
||||
handleError(w, InvalidRequestError{}, "Expected GET", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
func (a meService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
user, res, err := a.client.CurrentUser()
|
||||
|
||||
@@ -42,11 +36,8 @@ func (a meService) handler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
response := UserResponse{
|
||||
SuccessResponse: SuccessResponse{
|
||||
Message: "User fetched successfully",
|
||||
Status: http.StatusOK,
|
||||
},
|
||||
User: user,
|
||||
SuccessResponse: SuccessResponse{Message: "User fetched successfully"},
|
||||
User: user,
|
||||
}
|
||||
|
||||
err = json.NewEncoder(w).Encode(response)
|
||||
|
||||
Reference in New Issue
Block a user