mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5867] fix(codegen): include User-Agent header in HAR if missing #5385
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5385
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5867
Author: @swaraj017
Created: 2/11/2026
Status: 🔄 Open
Base:
main← Head:fix-user-agent-csharp-codegen📝 Commits (3)
9958dccfix(codegen): include User-Agent header in HAR if missingb707dbcfix(codegen): remove semicolon & fix blank lines in HAR headersaa62183Merge branch 'main' into fix-user-agent-csharp-codegen📊 Changes
1 file changed (+26 additions, -16 deletions)
View changed files
📝
packages/hoppscotch-common/src/helpers/new-codegen/har.ts(+26 -16)📄 Description
Description
When generating C# code using the "Show Code" feature, the User-Agent header was not included. This could cause problems with servers that expect a User-Agent to be present.
Browsers automatically attach a
User-Agentheader, but it is not part of the request data used during HAR-based code generation. Because of this, the generated code did not include it.This update ensures that a User-Agent header is added during HAR generation if one is not already provided in the request.
Related to #5772
Summary by cubic
Ensures HAR includes a User-Agent header (default "Hoppscotch") when missing so generated C# requests include it and work with servers that require it (addresses #5772). Also fixes HAR header formatting and avoids duplicate User-Agent entries.
Written for commit
aa62183355. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.