Branch: Tag:

2018-04-16

2018-04-16 13:46:15 by Pontus Östlund <ponost@roxen.com>

Static resource server: Added support for URL:s with anchor or query string.

This is necessary if you want to use <server-static-resources> on SVGs with symbols:

<svg>
<use xlink:href="/my/sprite.svg#my-symbol" />
</svg>

50:    string attr_name = process_tags[tag_name];    string link = args[attr_name];    if(link && has_prefix (link, "/") && !has_prefix (link, "//")) { +  sscanf(link, "%s%*[?#]", string raw_link); +     array(int)|Stdio.Stat st = -  id->conf->try_stat_file(link, id); +  id->conf->try_stat_file(raw_link, id);       if(st) {    if(arrayp(st))
61:       args[attr_name] =    Roxen.add_pre_state(link, (< "cache-forever", varystr >)); +  +  m_delete(args, "/"); +     return ({ Roxen.make_tag(tag_name, args, has_suffix (tag_name, "/"),    1) });    }