Attempting to change username to a taken path should properly return a validation error
Summary
Attempting to change username to a taken path should properly return a validation error, but didn't.
Steps to reproduce
https://gitlab.com/gitlab-com/support-forum/issues/3481
What is the current bug behavior?
Validation error red bar is empty.
See https://gitlab.com/gitlab-com/support-forum/issues/3481#note_88852632
What is the expected correct behavior?
Validation error red bar should say Username change failed - Username has already been taken
.
Additional info from user
Again, see https://gitlab.com/gitlab-com/support-forum/issues/3481#note_88852632
Request:
Host: gitlab.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: application/json, text/plain, */*
Referer: https://gitlab.com/profile/account
X-CSRF-Token: ...
X-Requested-With: XMLHttpRequest
Content-Type: application/json;charset=utf-8
Content-Length: 27
Cookie: ...
Connection: keep-alive
Response:
HTTP/1.1 422 Unprocessable Entity
Server: nginx
Date: Wed, 18 Jul 2018 15:52:56 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 2912
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Page-Title: GitLab
Pragma: no-cache
... X-Headers ...
The problem is, the response is an HTML document that previews to this:
I've tried replaying the request with Accept: application/json
, but it still replies with an HTML doc.
Edited by Michael Kozono