Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempting to add headers and add test #797

Merged
merged 13 commits into from
Oct 31, 2024

Conversation

Jacob-Eliat-Eliat
Copy link
Contributor

@Jacob-Eliat-Eliat Jacob-Eliat-Eliat commented Oct 30, 2024

I tried various approaches to test this feature, including:

  • request with different headers to cognite.com => no way to know which headers were sent
  • request to files with gzip disabled/enabled => seems like the file download endpoint doesn't compress, at least not for small files

In the end I gave up, but not before trying to see if the headers were correctly overriden using https://www.postman.com/postman/published-postman-templates/documentation/ae2ja6x/postman-echo?ctx=documentation and they are so this should be working right... but not sure how to test it properly without refactor

): F[Seq[Header]] =
sttpRequest
.headers(headers: _*)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that headers from sttpRequest would be preserved if not present in argument, it makes sense by default for things like x-cdp-app, x-cdp-sdk etc, for .acceptEncoding we can still override it with headers, but if main motivation is only acceptEncoding then maybe add dedicated parameter for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I can use "overrideHeaders" but that was my intention here. Just being a bit more general.

@Jacob-Eliat-Eliat Jacob-Eliat-Eliat merged commit 11ff1b4 into master Oct 31, 2024
8 checks passed
@Jacob-Eliat-Eliat Jacob-Eliat-Eliat deleted the add-headers-to-head-request branch October 31, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants