diff options
| author | vin <git@vineetk.net> | 2023-11-08 10:20:26 -0500 |
|---|---|---|
| committer | vin <git@vineetk.net> | 2023-11-08 10:24:50 -0500 |
| commit | aa816a646e43e44a43579e45228b28ad4ac92f57 (patch) | |
| tree | c5ee8ad16924755c21cff8b0469ea4173c89ee78 /aplus.go | |
| parent | 89c2e2b38ee57f40217db83fb34e014102b0fb49 (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.
Diffstat (limited to 'aplus.go')
| -rw-r--r-- | aplus.go | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -3,6 +3,7 @@ package main | |||
| 3 | import ( | 3 | import ( |
| 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) |
