Fix content-type header to prevent merging of duplicates #160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello
We've noticed that when the J1 node client targets a proxy instead of targeting JupiterOne's API directly, two headers of the same name are sent. Since it's HTTP 1.1, AWS Load Balancer seems to merge the two values into comma separated lists, which then eventually breaks when forwarding the request later to JupiterOne.
I can test by logging in the apollo-lin-back-http package locally
https://github.com/apollographql/apollo-link/blob/master/packages/apollo-link-batch-http/src/batchHttpLink.ts#L141
And I can see that the two headers are there in different casing, one added by J1 and another by apollo.
I can't understand why it works when targeting J1 API directly because doing a curl with the same headers causes a fail
This small fix makes sure that the header from J1 and from apollo are just using the same key. Tested locally and it worked fine for us. Didn't delete the header entirely since it's used in other places and didn't want to risk breaking that.
Ran a sync job that uses the
uploadGraphObjectsForSyncJob
and it still worked fine.