- Use URL as endpoint ID so handler path-segment lookups resolve correctly.
Previously CreateEndpoint generated a random UUID for the ID, but the
handler always queries by the path segment — every GetEndpoint call
missed, causing duplicate UNIQUE violations on subsequent requests
and orphaned request records (endpoint_id mismatch).
- Register both /{endpoint} and /{endpoint}/ patterns so bare and
nested capture paths both route to the handler (Go 1.22+ ServeMux).
- Strip query string in extractID for robustness, even though the
library never sends ? in r.URL.Path.
- Remove unused net/http import from handler_test.go (caught by vet).
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
||
|---|---|---|
| .. | ||
| handler_test.go | ||
| handler.go | ||