forked from loafle/openapi-generator-original
Remove path delimiters from downloading filename
This commit is contained in:
parent
3099aa2d85
commit
3c6639b4f6
@ -724,8 +724,9 @@ public class ApiClient {
|
|||||||
// Get filename from the Content-Disposition header.
|
// Get filename from the Content-Disposition header.
|
||||||
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
|
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
|
||||||
Matcher matcher = pattern.matcher(contentDisposition);
|
Matcher matcher = pattern.matcher(contentDisposition);
|
||||||
if (matcher.find())
|
if (matcher.find()) {
|
||||||
filename = matcher.group(1);
|
filename = matcher.group(1).replaceAll(".*[/\\\\]", "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String prefix = null;
|
String prefix = null;
|
||||||
|
@ -141,8 +141,8 @@ public class ApiClient {
|
|||||||
|
|
||||||
// Setup authentications (key: authentication name, value: authentication).
|
// Setup authentications (key: authentication name, value: authentication).
|
||||||
authentications = new HashMap<String, Authentication>();
|
authentications = new HashMap<String, Authentication>();
|
||||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
|
||||||
authentications.put("petstore_auth", new OAuth());
|
authentications.put("petstore_auth", new OAuth());
|
||||||
|
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||||
// Prevent the authentications from being modified.
|
// Prevent the authentications from being modified.
|
||||||
authentications = Collections.unmodifiableMap(authentications);
|
authentications = Collections.unmodifiableMap(authentications);
|
||||||
}
|
}
|
||||||
@ -723,8 +723,9 @@ public class ApiClient {
|
|||||||
// Get filename from the Content-Disposition header.
|
// Get filename from the Content-Disposition header.
|
||||||
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
|
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
|
||||||
Matcher matcher = pattern.matcher(contentDisposition);
|
Matcher matcher = pattern.matcher(contentDisposition);
|
||||||
if (matcher.find())
|
if (matcher.find()) {
|
||||||
filename = matcher.group(1);
|
filename = matcher.group(1).replaceAll(".*[/\\\\]", "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String prefix = null;
|
String prefix = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user