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

Support customized UserAgent in Http #469

Closed
BigVan opened this issue Apr 29, 2024 · 1 comment
Closed

Support customized UserAgent in Http #469

BigVan opened this issue Apr 29, 2024 · 1 comment
Assignees
Labels

Comments

@BigVan
Copy link
Contributor

BigVan commented Apr 29, 2024

Shall we provide a method() to customize HTTP UserAgent? Add Custom / Descriptive HTTP User-Agent for Overlaybd

Now it is a static variable.
https://github.com/alibaba/PhotonLibOS/blob/main/net/http/client.cpp#L253

@lihuiba
Copy link
Collaborator

lihuiba commented May 4, 2024

        op->req.headers.insert("User-Agent", USERAGENT);
        op->req.headers.insert("Connection", "keep-alive");
        op->req.headers.merge(m_common_headers);

@liulanzheng Maybe we should merge common headers first, then insert others like User-Agent and Connection? So that one can define a customized user agent by adding it to common headers, and which precludes the following insertion of another user agent (the default one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants