Persist cookies between multiple ynh_local_curl calls for the same app

This commit is contained in:
Jimmy Monin 2020-02-29 22:07:45 +01:00
parent 746d046250
commit e6481b156f

View file

@ -198,6 +198,7 @@ ynh_setup_source () {
} }
# Curl abstraction to help with POST requests to local pages (such as installation forms) # Curl abstraction to help with POST requests to local pages (such as installation forms)
# For multiple calls, cookies are persisted between each call for the same app
# #
# $domain and $path_url should be defined externally (and correspond to the domain.tld and the /path (of the app?)) # $domain and $path_url should be defined externally (and correspond to the domain.tld and the /path (of the app?))
# #
@ -238,7 +239,7 @@ ynh_local_curl () {
sleep 2 sleep 2
# Curl the URL # Curl the URL
curl --silent --show-error -kL -H "Host: $domain" --resolve $domain:443:127.0.0.1 $POST_data "$full_page_url" curl --silent --show-error -kL -H "Host: $domain" --resolve $domain:443:127.0.0.1 $POST_data "$full_page_url" --cookie-jar /tmp/ynh-$app-cookie.txt --cookie /tmp/ynh-$app-cookie.txt
} }
# Render templates with Jinja2 # Render templates with Jinja2