Skip to content

Commit 4530ece

Browse files
committed
fix #1072
1 parent a5ac2f5 commit 4530ece

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

decompressed/gui_file/www/docroot/js/shared-script.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,13 @@ var modgui = modgui || {};
190190
mac: mac,
191191
CSRFtoken: $("meta[name=CSRFtoken]").attr("content")
192192
},
193-
dataType: 'json',
194193
error: function() {
195194
div.removeClass("fa fa-sync fa-spin");
196195
div.text('Error');
197196
},
198197
success: function (data) {
199198
div.removeClass("fa fa-sync fa-spin");
200-
div.text(data.company || 'Unknown');
199+
div.text(data || 'Unknown');
201200
}
202201
});
203202
}

decompressed/gui_file/www/docroot/modals/modgui-modal.lp

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ if ngx.req.get_method() == "POST" then
282282
return sendcmd("checkver")
283283
end
284284
if action == "getVendor" then
285-
ngx.print(call_popen(untaint("curl -m 2 http://api.maclookup.app/v1/macs/" .. post_args.mac:gsub('_.*','')), "r"))
285+
ngx.print(call_popen(untaint("! grep -q " .. post_args.mac:gsub('_.*','') .. " /tmp/mac_cache && (curl -ksm 2 https://api.maclookup.app/v2/macs/" .. post_args.mac:gsub('_.*','') .. "/company/name >> /tmp/mac_cache; echo '|" .. post_args.mac:gsub('_.*','') .. "' >> /tmp/mac_cache); grep " .. post_args.mac:gsub('_.*','') .. " /tmp/mac_cache | cut -d'|' -f1"), "r"))
286286
ngx.exit(ngx.HTTP_OK)
287287
return
288288
end

0 commit comments

Comments
 (0)