paivana

HTTP paywall reverse proxy
Log | Files | Refs | Submodules | README | LICENSE

commit ea9c4ec19991b887a8c1d97fa1837f09394afd02
parent 2e1509a881af17604e00c980ecd578e6ea1db3f8
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun,  2 Aug 2026 23:05:21 +0200

validate 'website' is a URL

Diffstat:
Mmeson.build | 11+++++++++++
Msrc/backend/meson.build | 3+--
Msrc/backend/paivana-httpd_pay.c | 3++-
3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build @@ -168,6 +168,17 @@ if not get_option('only-doc') ) private_config.set10('HAVE_TALERMHD', talermhd_dep.found()) + talerjson_dep = dependency('talerjson', required: false) + if not talerjson_dep.found() + talerjson_dep = cc.find_library('talerjson', required: true) + endif + cc.has_header_symbol( + 'taler/taler_json_lib.h', + 'TALER_JSON_spec_slug', + required: true, + dependencies: [talerjson_dep], + ) + private_config.set10('HAVE_TALERJSON', talerjson_dep.found()) talerexchange_dep = dependency('talerexchange', required: false) if not talerexchange_dep.found() diff --git a/src/backend/meson.build b/src/backend/meson.build @@ -20,6 +20,7 @@ paivana_httpd_exe = executable( talerutil_dep, gcrypt_dep, talermhd_dep, + talerjson_dep, gnunetutil_dep, gnunetjson_dep, gnunetcurl_dep, @@ -31,5 +32,3 @@ paivana_httpd_exe = executable( include_directories: [incdir, configuration_inc], install: true, ) - - diff --git a/src/backend/paivana-httpd_pay.c b/src/backend/paivana-httpd_pay.c @@ -26,6 +26,7 @@ #include <microhttpd.h> #include <gnunet/gnunet_util_lib.h> #include <taler/taler_mhd_lib.h> +#include <taler/taler_json_lib.h> #include <taler/taler_error_codes.h> #include "paivana-httpd_cookie.h" #include "paivana-httpd_helper.h" @@ -361,7 +362,7 @@ PAIVANA_HTTPD_payment_handle (struct PayRequest *ph, struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("order_id", &ph->order_id), - GNUNET_JSON_spec_string ("website", + TALER_JSON_spec_web_url ("website", &ph->website), GNUNET_JSON_spec_timestamp ("cur_time", &ph->cur_time),