summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvin <git@vineetk.net>2023-11-08 10:20:26 -0500
committervin <git@vineetk.net>2023-11-08 10:24:50 -0500
commitaa816a646e43e44a43579e45228b28ad4ac92f57 (patch)
treec5ee8ad16924755c21cff8b0469ea4173c89ee78
parent89c2e2b38ee57f40217db83fb34e014102b0fb49 (diff)
fix "LTI signature verification failed" message
Some of the form values being sent in the POST request had HTML entities that needed to be unescaped.
-rw-r--r--aplus.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/aplus.go b/aplus.go
index e2ec53b..ae5e054 100644
--- a/aplus.go
+++ b/aplus.go
@@ -3,6 +3,7 @@ package main
3import ( 3import (
4 "encoding/json" 4 "encoding/json"
5 "fmt" 5 "fmt"
6 "html"
6 "io" 7 "io"
7 "net/http" 8 "net/http"
8 "net/url" 9 "net/url"
@@ -41,7 +42,7 @@ func parse_form(form_html string) url.Values {
41 for _, input := range inputs { 42 for _, input := range inputs {
42 // Extract field name and value 43 // Extract field name and value
43 name := extract_attribute(input, "name") 44 name := extract_attribute(input, "name")
44 value := extract_attribute(input, "value") 45 value := html.UnescapeString(extract_attribute(input, "value"))
45 46
46 if name != "" { 47 if name != "" {
47 form_values.Add(name, value) 48 form_values.Add(name, value)