From 973caf46afb0f36ce648d582663bd10f0ae986bf Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 3 Aug 2021 21:20:35 -0700 Subject: [PATCH] projects: make application/json the default initial jsontype The old 'application/x-www-form-urlencoded' type continues to be supported; any projects that existed prior to the addition of the "jsontype" setting and do not have it configured will continue to be interpreted as 'application/x-www-form-urlencoded' when loaded to preserve backwards compatibility. For new projects though, make the default the more modern 'application/json' type instead of the outdated 'application/x-www-form-urlencoded' type. Signed-off-by: Kyle J. McKay --- Girocco/Project.pm | 3 ++- cgi/regproj.cgi | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Girocco/Project.pm b/Girocco/Project.pm index 5f6b765..dbad925 100644 --- a/Girocco/Project.pm +++ b/Girocco/Project.pm @@ -74,7 +74,7 @@ sub _rmtype_choices { } sub _json_choices { - return ('application/x-www-form-urlencoded', 'application/json'); + return ('application/json', 'application/x-www-form-urlencoded'); } sub _mkdir_forkees { @@ -756,6 +756,7 @@ sub ghost { $self->{mirror} = $mirror; $self->{email} = $self->{orig_email} = ''; $self->{notifyjson} = $self->{orig_notifyjson} = ''; + $self->{jsontype} = 'application/json'; # new project default $self; } diff --git a/cgi/regproj.cgi b/cgi/regproj.cgi index ed24703..60965ae 100755 --- a/cgi/regproj.cgi +++ b/cgi/regproj.cgi @@ -41,6 +41,7 @@ my %values = ( notifyjson => '', notifycia => '', README => '', + jsontype => 'application/json', rmtype => 'Markdown', source => 'Anywhere', url => '', -- 2.11.4.GIT