Fix form parsing

This commit is contained in:
Sulka Haro
2021-02-08 22:08:20 +02:00
parent 6a044523a8
commit 4d4b7b844d
2 changed files with 7 additions and 3 deletions
+2
View File
@@ -502,6 +502,8 @@ function init (client, $) {
$.ajax({
method: 'POST'
, dataType: 'json'
, contentType: 'application/json'
, url: '/api/v1/treatments/'
, headers: client.headers()
, data: data
+5 -3
View File
@@ -26,6 +26,8 @@ function create (env, ctx) {
var appInfo = env.name + ' ' + env.version;
app.set('title', appInfo);
app.enable('trust proxy'); // Allows req.secure test on heroku https connections.
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
var insecureUseHttp = env.insecureUseHttp;
var secureHstsHeader = env.secureHstsHeader;
if (!insecureUseHttp) {
@@ -244,11 +246,11 @@ function create (env, ctx) {
app.use("/clock", clockviews);
app.use('/api', bodyParser.json({limit: '50mb'}), apiRoot);
app.use('/api', apiRoot);
app.use('/api/v1', bodyParser.json({limit: '50mb'}), api);
app.use('/api/v1', api);
app.use('/api/v2', bodyParser.json({limit: '50mb'}), api);
app.use('/api/v2', api);
app.use('/api/v2/properties', ctx.properties);
app.use('/api/v2/authorization', ctx.authorization.endpoints);