Skip to content

Commit

Permalink
v0.6.44
Browse files Browse the repository at this point in the history
  • Loading branch information
mbloch committed Oct 3, 2023
1 parent 97d297d commit 7437d90
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
v0.6.44
* Added -style css= option for adding inline CSS to SVG symbols.
* Bug fixes

v0.6.43
* Bug fixes

Expand Down
4 changes: 3 additions & 1 deletion REFERENCE.md
@@ -1,6 +1,6 @@
# COMMAND REFERENCE

This documentation applies to version 0.6.39 of mapshaper's command line program. Run `mapshaper -v` to check your version. For an introduction to the command line tool, read [this page](https://github.com/mbloch/mapshaper/wiki/Introduction-to-the-Command-Line-Tool) first.
This documentation applies to version 0.6.43 of mapshaper's command line program. Run `mapshaper -v` to check your version. For an introduction to the command line tool, read [this page](https://github.com/mbloch/mapshaper/wiki/Introduction-to-the-Command-Line-Tool) first.

## Command line syntax

Expand Down Expand Up @@ -1213,6 +1213,8 @@ Add common SVG attributes for SVG export and display in the web UI. Attribute va

`class=` One or more CSS classes, separated by spaces (e.g. `class="light semi-transparent"`)

`css=` Inline CSS to use as the `style=` attribute of each SVG symbol.

`fill=` Fill color (e.g. `#eee` `pink` `rgba(0, 0, 0, 0.2)`)

`fill-pattern=` Definition string for a pattern. There are four pattern types: hatches, dots, squares and dashes. The syntax for each pattern is:
Expand Down
11 changes: 9 additions & 2 deletions bin/mapshaper-gui
Expand Up @@ -61,7 +61,10 @@ function startServer(port) {
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname;
clearTimeout(timeout);
if (uri == '/close') {
if (uri.includes('..')) {
// block attempts to load files outside webroot
serve404(response);
} else if (uri == '/close') {
// end process when page closes, unless page is immediately refreshed
timeout = setTimeout(function() {
process.exit(0);
Expand Down Expand Up @@ -116,10 +119,14 @@ function serveError(text, code, response) {
response.end();
}

function serve404(response) {
serveError("404 Not Found\n", 404, response);
}

function serveFile(filename, response) {
fs.readFile(filename, function(err, content) {
if (err) {
serveError("404 Not Found\n", 404, response);
serve404(response);
} else {
serveContent(content, response, getMimeType(filename));
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "mapshaper",
"version": "0.6.43",
"version": "0.6.44",
"description": "A tool for editing vector datasets for mapping and GIS.",
"keywords": [
"shapefile",
Expand Down

0 comments on commit 7437d90

Please sign in to comment.