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

Fix for encoding error enrolling new nodes #334

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions admin/handlers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ func removeBackslash(rawString string) string {
return strings.ReplaceAll(rawString, "\\", " ")
}

// Helper to convert json.RawMessage into indented string
func jsonRawIndent(raw json.RawMessage) string {
// Helper to convert string into indented string
func jsonRawIndent(raw string) string {
var out bytes.Buffer
if err := json.Indent(&out, raw, "", " "); err != nil {
if err := json.Indent(&out, []byte(raw), "", " "); err != nil {
return string(raw)
}
return string(out.Bytes())
Expand Down
6 changes: 3 additions & 3 deletions admin/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ func incMetric(name string) {
}
}

// Helper to convert json.RawMessage into indented string
func jsonRawIndent(raw json.RawMessage) string {
// Helper to convert string into indented string
func jsonRawIndent(raw string) string {
var out bytes.Buffer
if err := json.Indent(&out, raw, "", " "); err != nil {
if err := json.Indent(&out, []byte(raw), "", " "); err != nil {
return string(raw)
}
return string(out.Bytes())
Expand Down
Loading