aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--http_handle_repo_tree.go2
-rw-r--r--reamde_to_html.go8
2 files changed, 5 insertions, 5 deletions
diff --git a/http_handle_repo_tree.go b/http_handle_repo_tree.go
index 190f082..ae9efbc 100644
--- a/http_handle_repo_tree.go
+++ b/http_handle_repo_tree.go
@@ -84,7 +84,7 @@ func handle_repo_tree(w http.ResponseWriter, r *http.Request, params map[string]
http.Error(w, "Error formatting code: "+err.Error(), http.StatusInternalServerError)
return
}
- formatted_encapsulated = template.HTML(formatted_unencapsulated.Bytes())
+ formatted_encapsulated = template.HTML(formatted_unencapsulated.Bytes()) //#nosec G203
params["file_contents"] = formatted_encapsulated
render_template(w, "repo_tree_file", params)
diff --git a/reamde_to_html.go b/reamde_to_html.go
index 4564344..29c61ca 100644
--- a/reamde_to_html.go
+++ b/reamde_to_html.go
@@ -29,7 +29,7 @@ func render_readme_at_tree(tree *object.Tree) (readme_filename string, readme_co
return "Error fetching README", string_escape_html("Unable to fetch contents of README: " + err.Error())
}
- return "README", template.HTML("<pre>" + html.EscapeString(readme_file_contents) + "</pre>")
+ return "README", template.HTML("<pre>" + html.EscapeString(readme_file_contents) + "</pre>") //#nosec G203
}
if readme_file, err = tree.File("README.md"); err == nil {
@@ -41,7 +41,7 @@ func render_readme_at_tree(tree *object.Tree) (readme_filename string, readme_co
return "Error fetching README", string_escape_html("Unable to render README: " + err.Error())
}
- return "README.md", template.HTML(bluemonday.UGCPolicy().SanitizeBytes(readme_rendered_unsafe.Bytes()))
+ return "README.md", template.HTML(bluemonday.UGCPolicy().SanitizeBytes(readme_rendered_unsafe.Bytes())) //#nosec G203
}
if readme_file, err = tree.File("README.org"); err == nil {
@@ -54,12 +54,12 @@ func render_readme_at_tree(tree *object.Tree) (readme_filename string, readme_co
return "Error fetching README", string_escape_html("Unable to render README: " + err.Error())
}
- return "README.org", template.HTML(bluemonday.UGCPolicy().Sanitize(org_html))
+ return "README.org", template.HTML(bluemonday.UGCPolicy().Sanitize(org_html)) //#nosec G203
}
return "", ""
}
func string_escape_html(s string) template.HTML {
- return template.HTML(html.EscapeString(s))
+ return template.HTML(html.EscapeString(s)) //#nosec G203
}