mapshaper 0.7.22 → 0.7.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mapshaper-gui +3 -5
- package/mapshaper.js +5305 -1766
- package/package.json +9 -6
- package/www/geopackage.js +4 -1
- package/www/index.html +21 -19
- package/www/mapshaper-gui.js +74 -27
- package/www/mapshaper.js +5305 -1766
- package/www/modules.js +8 -455
- package/www/page.css +60 -1
- package/www/sponsor.html +1 -0
package/bin/mapshaper-gui
CHANGED
|
@@ -24,7 +24,6 @@ var defaultPort = 5555,
|
|
|
24
24
|
opts = program.opts(),
|
|
25
25
|
http = require("http"),
|
|
26
26
|
path = require("path"),
|
|
27
|
-
url = require("url"),
|
|
28
27
|
fs = require("fs"),
|
|
29
28
|
Cookies = require("cookies"),
|
|
30
29
|
webRoot = path.join(__dirname, "../www"),
|
|
@@ -78,7 +77,7 @@ function startServer(port) {
|
|
|
78
77
|
var timeout;
|
|
79
78
|
|
|
80
79
|
http.createServer(function(request, response) {
|
|
81
|
-
var uri =
|
|
80
|
+
var uri = new URL(request.url, 'http://localhost').pathname;
|
|
82
81
|
clearTimeout(timeout);
|
|
83
82
|
if (uri.includes('..')) {
|
|
84
83
|
// block attempts to load files outside webroot
|
|
@@ -233,9 +232,8 @@ function findInputFile(ofile) {
|
|
|
233
232
|
function saveContent(req, res) {
|
|
234
233
|
var requestId = new Cookies(req, res).get('session_id'),
|
|
235
234
|
ip = req.connection.remoteAddress,
|
|
236
|
-
urlData =
|
|
237
|
-
|
|
238
|
-
file = query.file;
|
|
235
|
+
urlData = new URL(req.url, 'http://localhost'),
|
|
236
|
+
file = urlData.searchParams.get('file');
|
|
239
237
|
|
|
240
238
|
if (opts.forceSave) {
|
|
241
239
|
// match output file to input file (including original path to the input file)
|