Remove duplicate X-Request-Id response header
This fixes the performance bar not working with AJAX requests.
Both LabKit and Rails were injecting duplicate X-Request-Id
headers into
the response stream, which caused the frontend to be interpret the value
as a comma-separated value (e.g. LdEgVXsp1R4, LdEgVXsp1R4).
The new flow behaves as the following:
- Workhorse injects X-Request-Id to the inbound HTTP request to Rails
- Rails looks up this value in its RequestId middleware. Since the value exists, Rails sets the X-Request-Id response header to this value: https://github.com/rails/rails/blob/c4d3e202e10ae627b3b9c34498afb45450652421/actionpack/lib/action_dispatch/middleware/request_id.rb#L29-L30
- Workhorse doesn't append another header in the response.
Distributed tracing still works fine with any request that gets sent to Rails, but for any endpoints that bypass Rails should still work fine because Workhorse still generates the initial correlation ID.
Note: Once labkit!17 (diffs) is merged, we can restore the response header.
Edited by Stan Hu