Skip to content

Commit

Permalink
Json content type detection in E_UrlFetch is now more lenient.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aklakan committed Oct 22, 2024
1 parent ae60515 commit 12b49ff
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public class E_UrlFetch
{
private static final Logger logger = LoggerFactory.getLogger(E_UrlFetch.class);

public static final Pattern jsonContentTypePattern = Pattern.compile("^application/(.+\\+)?json$");
/** Liberal pattern that checks for any content type ending in json.*/
public static final Pattern jsonContentTypePattern = Pattern.compile("^[^/]*/([^;+]+\\+)*json\\s*(;.*)?$");
// ^Anything without /
// ^All groups ending on '+'

@Override
public NodeValue exec(List<NodeValue> args, FunctionEnv env) {
Expand Down

0 comments on commit 12b49ff

Please sign in to comment.