Skip to content

Commit

Permalink
fix: send correct UA for LAMA API requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-karan committed Jul 10, 2023
1 parent 220617e commit 4febb70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/nse/nse.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

const (
USER_AGENT = "mii-lama"
USER_AGENT = "LAMAAPI/1.0.0"
NSE_RESP_CODE_SUCCESS = 601
NSE_RESP_CODE_PARTIAL_SUCCESS = 602
NSE_RESP_CODE_INVALID_LOGIN = 701
Expand Down Expand Up @@ -129,8 +129,11 @@ func New(lo *slog.Logger, opts Opts) (*Manager, error) {
h.Set("Content-Type", "application/json")
h.Set("Referer", opts.URL)
h.Set("User-Agent", USER_AGENT)
h.Set("Accept-Language", "en-US")
if strings.Contains(opts.URL, "uat") {
h.Add("Cookie", "test")
} else {
h.Add("Cookie", "prod")
}

// Set common fields for logger.
Expand Down

0 comments on commit 4febb70

Please sign in to comment.