start adding handling for lnurlp
This commit is contained in:
parent
79c6369c39
commit
e16fca179b
6 changed files with 107 additions and 8 deletions
|
|
@ -182,7 +182,7 @@ func parse_request(req *http.Request) (int, error) {
|
|||
card_count, err := db_get_card_count_for_uid(uid_str)
|
||||
|
||||
if err != nil {
|
||||
return 0, errors.New("could not get card records count")
|
||||
return 0, errors.New("could not get card count for uid")
|
||||
}
|
||||
|
||||
if card_count == 0 {
|
||||
|
|
@ -246,6 +246,13 @@ func parse_request(req *http.Request) (int, error) {
|
|||
|
||||
func lnurlw_response(w http.ResponseWriter, req *http.Request) {
|
||||
|
||||
env_host_domain := os.Getenv("HOST_DOMAIN")
|
||||
if req.Host != env_host_domain {
|
||||
log.Warn("wrong host domain")
|
||||
write_error(w)
|
||||
return
|
||||
}
|
||||
|
||||
card_id, err := parse_request(req)
|
||||
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue