Restheadspec now takes parameters from query parameters and headers. Allows for backward compatibility with our old dojo clients

This commit is contained in:
Hein
2025-11-21 08:56:58 +02:00
parent 59bd709460
commit c2e0c36c79
5 changed files with 441 additions and 4 deletions

View File

@@ -117,6 +117,16 @@ func (h *HTTPRequest) QueryParam(key string) string {
return h.req.URL.Query().Get(key)
}
func (h *HTTPRequest) AllQueryParams() map[string]string {
params := make(map[string]string)
for key, values := range h.req.URL.Query() {
if len(values) > 0 {
params[key] = values[0]
}
}
return params
}
func (h *HTTPRequest) AllHeaders() map[string]string {
headers := make(map[string]string)
for key, values := range h.req.Header {