From 285cee53a06952bcd70c222789d0c0ee2fea8bac Mon Sep 17 00:00:00 2001 From: Jamelele <35628223+Jamelele@users.noreply.github.com> Date: Sun, 24 May 2020 21:04:06 +0000 Subject: [PATCH] Set correct headers for NUI callbacks --- nui/radar.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nui/radar.js b/nui/radar.js index a37e4af..5471414 100644 --- a/nui/radar.js +++ b/nui/radar.js @@ -620,6 +620,13 @@ function displayKeyLock( state ) }, 2000 ); } +// Prepare headers for HTTP requests +$.ajaxSetup({ + headers: { + 'Content-Type': 'application/json; charset=UTF-8', + }, + }); + // This function is used to send data back through to the LUA side function sendData( name, data ) { $.post( "https://" + resourceName + "/" + name, JSON.stringify( data ), function( datab ) { @@ -1033,7 +1040,7 @@ $( "body" ).find( "button, div" ).each( function( i, obj ) { ------------------------------------------------------------------------------------*/ function closeRemote() { - sendData( "closeRemote", {} ); + sendData( "closeRemote", null ); setEleVisible( elements.plateReaderBox, false ); setEleVisible( elements.uiSettingsBox, false );