10000 Consider adding support for adding optional headers for http requests · Issue #204 · oras-project/oras-dotnet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Consider adding support for adding optional headers for http requests #204

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

Open
1 task
akashsinghal opened this issue Apr 14, 2025 · 3 comments
Open
1 task
Labels
enhancement New feature or request
Milestone

Comments

@akashsinghal
Copy link

What is the version or commit of the ORAS .NET library?

No response

What would you like to be added?

There doesn't seem to be a way to specify custom headers to be added to outbound registry http calls. (please correct me if I'm wrong). It would be nice to allow this so that custom headers, such as correlation ids, can be added.

Why is this needed for the ORAS .NET library?

Makes http requests more robust and customizable

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.
@akashsinghal akashsinghal added enhancement New feature or request triage New issues or PRs to be acknowledged by maintainers labels Apr 14, 2025
@Wwwsylvia
Copy link
Member

Hi @akashsinghal , do you want to set the same headers for all requests? Or do you want to set different headers for different requests?
If it's the former, does the following code help?

var client = new HttpClientWithBasicAuth(username, password);
client.DefaultRequestHeaders.Add("CorrelationId", "12345");

We are implementing a more flexible auth client which will replace HttpClientWithBasicAuth. See #200 .

@akashsinghal
Copy link
Author
akashsinghal commented Apr 24, 2025

@Wwwsylvia I'd like to set different headers for different requests. Thus setting the default request headers at the client level won't help. If there's a way to configure on the request object itself and not on the client, that would be helpful.

@Wwwsylvia
Copy link
Member

@akashsinghal I see. Thanks for the feedback!

@Wwwsylvia Wwwsylvia removed the triage New issues or PRs to be acknowledged by maintainers label May 22, 2025
@Wwwsylvia Wwwsylvia added this to the v0.4.0 milestone May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants
0