mount a json file on client-side or server-side?

Asked

Viewed 37 times

0

the . json file I’m developing is entirely being mounted on the client-side, is that good practice? a part of the code:

                array.form[array.form.length - 1].perg.push({
                    numerodaperguntaSemPonto: retiraPonto(numeroDaPergunta[0].value),
                    descricaoQuestao: descricaoQuestao[0].value,
                    notapergunta: questao[0].value,
                    titleSub: [],
                    isObrig: false
                });

1 answer

0

Depends,

  1. If the file is downloaded by the user: no problem at all, just be careful: if it is imported, you should do a security check.
  2. If JSON is sent to a server, do the server-side check, it can be very easy to manipulate this data at the time of the request

Browser other questions tagged

You are not signed in. Login or sign up in order to post.