[MODUSERSKC-7] /users-keycloak/users/SOME_UUID expects wrong "accept" header content-type Created: 11/Jan/24  Updated: 02/Feb/24

Status: In Review
Project: mod-users-keycloak
Components: None
Affects versions: None
Fix versions: None

Type: Bug Priority: P2
Reporter: Zak Burke Assignee: Oleksii Kuzminov
Resolution: Unresolved Votes: 0
Labels: back-end, epam-eureka, eureka-phase4
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: File MODUSERSKC-7_put.mp4    
Issue links:
Defines
defines UXPROD-4605 Component Ownership In Progress
Sprint: Eureka Sprint 44, Eureka Sprint 45
Story Points: 1
Development Team: Eureka
RCA Group: TBD

 Description   

Summary: PUT requests to /users-keycloak/users/SOME_UUID with the HTTP Request header accept: text/plain fail.

Details: PUT requests to /users-keycloak/users/SOME_UUID are rejected with response code 406 unless they contain the HTTP Request header accept: application/javascript, even though the response body is empty. This is inconsistent with other FOLIO APIs which all accept PUT requests with the HTTP request header accept: text/plain.

This prevents the UI from being able to save changes to user records.

Steps to reproduce:

  • Make a PUT request with the header accept: text/plain:
curl 'https://kong-evrk.int.aws.folio.org/users-keycloak/users/329a8cf5-2e6b-4f42-bebf-b12824f74660' \
  -X 'PUT' \
  -H 'accept: text/plain' \
  -H 'accept-language: en-US' \
  -H 'content-type: application/json' \
  -H 'x-okapi-tenant: diku' \
  -H 'x-okapi-token:  SOME_TOKEN' \
  --data-raw '{"username":"mcpatron","id":"329a8cf5-2e6b-4f42-bebf-b12824f74660","active":true,"type":"patron","patronGroup":"e5ece9c8-1bbe-4898-98b6-a42064f0078d","departments":[],"proxyFor":[],"personal":{"lastName":"McPatron","firstName":"Patron","preferredFirstName":"Yoknapatawphaa","email":"patron@example.com","preferredContactTypeId":"002"},"createdDate":"2024-01-10T04:03:28.695+00:00","updatedDate":"2024-01-10T04:03:28.695+00:00","metadata":{"createdDate":"2024-01-09T22:13:01.397+00:00","createdByUserId":"3fe83d88-1b7e-41de-8723-222a1807a326","updatedDate":"2024-01-10T04:03:28.689+00:00","updatedByUserId":"3fe83d88-1b7e-41de-8723-222a1807a326"},"customFields":{}}' \
-v

Expected results: Request succeeds:

< HTTP/2 204 
< date: Thu, 11 Jan 2024 19:53:56 GMT
< server: nginx/1.18.0 (Ubuntu)
< access-control-allow-origin: *
< x-kong-upstream-latency: 272
< x-kong-proxy-latency: 22
< via: kong/3.4.2 

Actual results: Request fails:

< HTTP/2 406 
< date: Thu, 11 Jan 2024 19:52:21 GMT
< content-length: 0
< server: nginx/1.18.0 (Ubuntu)
< accept: application/json
< access-control-allow-origin: *
< x-kong-upstream-latency: 21
< x-kong-proxy-latency: 22
< via: kong/3.4.2


 Comments   
Comment by Yauhen Viazau [ 02/Feb/24 ]

Tested on "evrk" - works as expected

PUT requests to /users-keycloak/users/<user UUID> executed successfully with "Accept" header with following values:

  • "*/*"
  • "text/plain"
  • "application/json"

See screencast with an example: MODUSERSKC-7_put.mp4

Note: Response with 406 status returned in case of "application/javascript" in "Accept" header

Generated at Thu Feb 08 22:28:59 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.