diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 5f3c56ca..45e73dc1 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -1,21 +1,20 @@
# OpenAS2 Server
-# Version 3.1.0
+# Version 3.2.0
# RELEASE NOTES
-----
-The OpenAS2 project is pleased to announce the release of OpenAS2 3.1.0
+The OpenAS2 project is pleased to announce the release of OpenAS2 3.2.0
-The release download file is: OpenAS2Server-3.1.0.zip
+The release download file is: OpenAS2Server-3.2.0.zip
The zip file contains a PDF document (OpenAS2HowTo.pdf) providing information on installing and using the application.
## NOTE: Testing covers Java 8 to 17. The application should work for older versions down to Java 7 but they are not tested as part of the CI/CD pipeline.
-Version 3.1.0 - 2022-06-04
+Version 3.2.0 - 2022-06-21
This is a minor enhancement and bugfix release:
**IMPORTANT NOTE**: Please review upgrade notes below if you are upgrading
- 1. Support embedded $properties.xxx$ within property element values.
- 2. Support setting unix executables in ZIP file when packaging new release in Maven.
- 3. Fix asynchronous MDN sending and receiving.
+ 1. Support "prevent_chunking" attribute on partnership to support older AS2 systems.
+ 2. Fix copying the sent file to the sent folder when successfully sent.
##Upgrade Notes
diff --git a/Remote/pom.xml b/Remote/pom.xml
index 15baa2ba..6edf1f77 100644
--- a/Remote/pom.xml
+++ b/Remote/pom.xml
@@ -4,7 +4,7 @@
net.sf.openas2
OpenAS2
- 3.1.0
+ 3.2.0
4.0.0
diff --git a/Server/pom.xml b/Server/pom.xml
index c26c532d..b3f2e67e 100644
--- a/Server/pom.xml
+++ b/Server/pom.xml
@@ -7,7 +7,7 @@
net.sf.openas2
OpenAS2
- 3.1.0
+ 3.2.0
../pom.xml
diff --git a/Server/src/main/java/CheckCertificate.java b/Server/src/main/java/CheckCertificate.java
index bee6448e..592868d9 100644
--- a/Server/src/main/java/CheckCertificate.java
+++ b/Server/src/main/java/CheckCertificate.java
@@ -226,7 +226,7 @@ private void checkUsingApacheHttp(String host, int port, String uri, String targ
httpOptions.put(HTTPUtil.PARAM_HTTP_USER, auth_user);
httpOptions.put(HTTPUtil.PARAM_HTTP_PWD, auth_pwd);
}
- ResponseWrapper resp = HTTPUtil.execRequest(HTTPUtil.Method.POST, "https://" + host + ":" + port + "/" + uri, null, null, new ByteArrayInputStream("Testing".getBytes()), httpOptions, 1000000000);
+ ResponseWrapper resp = HTTPUtil.execRequest(HTTPUtil.Method.POST, "https://" + host + ":" + port + "/" + uri, null, null, new ByteArrayInputStream("Testing".getBytes()), httpOptions, 1000000000, false);
System.out.println("Got a response using Apache HTTP Client: " + resp.getStatusCode());
System.out.println("\t\tHEADERS: " + resp.getHeaders());
System.out.println("\t\tBODY: " + resp.getBody());
diff --git a/Server/src/main/java/org/openas2/partner/Partnership.java b/Server/src/main/java/org/openas2/partner/Partnership.java
index e2ae098b..a8bf0038 100644
--- a/Server/src/main/java/org/openas2/partner/Partnership.java
+++ b/Server/src/main/java/org/openas2/partner/Partnership.java
@@ -55,7 +55,8 @@ public class Partnership implements Serializable {
public static final String PA_CUSTOM_MIME_HEADER_NAMES_REGEX_ON_FILENAME = "custom_mime_header_names_regex_on_filename"; // Regex to split filename into values
public static final String PAIB_NAMES_FROM_FILENAME = "attribute_names_from_filename"; // List of attribute names to be set from parsed filename
public static final String PAIB_VALUES_REGEX_ON_FILENAME = "attribute_values_regex_on_filename"; // Regex to split filename into values
- public static final String PA_HTTP_NO_CHUNKED_MAX_SIZE = "no_chunked_max_size"; // Disables chunked HTTP transfer when file size is set larger as 0
+ public static final String PA_HTTP_NO_CHUNKED_MAX_SIZE = "no_chunked_max_size"; // Disables chunked HTTP transfer when file size is set larger than the value in this param
+ public static final String PA_HTTP_PREVENT_CHUNKING = "prevent_chunking"; // Will try to force the send without using chunked HTTP transfer
public static final String PA_STORE_RECEIVED_FILE_TO = "store_received_file_to"; // Allows overriding the MessageFileModule "filename" parameter per partnership
// A hopefully temporary key to maintain backwards compatibility
public static final String USE_NEW_CERTIFICATE_LOOKUP_MODE = "use_new_certificate_lookup_mode";
@@ -86,6 +87,10 @@ public void setAttribute(String id, String value) {
getAttributes().put(id, value);
}
+ /** Gets the value of the attribute for the provided key
+ * @param id
+ * @return Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
+ */
public String getAttribute(String id) {
return getAttributes().get(id);
}
@@ -254,10 +259,6 @@ public boolean isRemoveCmsAlgorithmProtectionAttr() {
return "true".equalsIgnoreCase(getAttribute(Partnership.PA_REMOVE_PROTECTION_ATTRIB));
}
- public boolean isNoChunkedTransfer() {
- return (getNoChunkedMaxSize() > 0L);
- }
-
public long getNoChunkedMaxSize() {
long max = 0L;
try {
@@ -267,4 +268,8 @@ public long getNoChunkedMaxSize() {
return max;
}
+ public boolean isPreventChunking(boolean defaultPreference) {
+ String preventChunking = getAttribute(Partnership.PA_HTTP_PREVENT_CHUNKING);
+ return preventChunking == null?defaultPreference:"true".equalsIgnoreCase(preventChunking);
+ }
}
diff --git a/Server/src/main/java/org/openas2/processor/receiver/DirectoryPollingModule.java b/Server/src/main/java/org/openas2/processor/receiver/DirectoryPollingModule.java
index 5546e9ee..c36ff55c 100644
--- a/Server/src/main/java/org/openas2/processor/receiver/DirectoryPollingModule.java
+++ b/Server/src/main/java/org/openas2/processor/receiver/DirectoryPollingModule.java
@@ -9,7 +9,7 @@
import org.openas2.util.IOUtil;
import java.io.File;
-import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.DirectoryStream;
@@ -238,20 +238,12 @@ protected void processFile(File file) throws OpenAS2Exception {
logger.info("processing " + file.getAbsolutePath());
}
- try (FileInputStream in = new FileInputStream(file)) {
- processDocument(in, file.getName());
- try {
- if(sentDir != null) {
- // Archive Sent file on disk
- IOUtil.handleArchive(file, sentDir, false);
- }else{
- IOUtil.deleteFile(file);
- }
- } catch (IOException e) {
- throw new OpenAS2Exception("Failed to archive/remove file handed off for processing:" + file.getAbsolutePath(), e);
- }
- } catch (IOException e) {
- throw new OpenAS2Exception("Failed to process file:" + file.getAbsolutePath(), e);
+ try {
+ processDocument(file, file.getName());
+ } catch (FileNotFoundException e) {
+ // Try to move original file to error dir in case error handling has not done it for us.
+ IOUtil.handleArchive(file, errorDir, false);
+ throw new OpenAS2Exception("Failed to initiate processing for file:" + file.getAbsolutePath(), e);
}
}
diff --git a/Server/src/main/java/org/openas2/processor/receiver/MessageBuilderModule.java b/Server/src/main/java/org/openas2/processor/receiver/MessageBuilderModule.java
index c06e1575..4aadec79 100644
--- a/Server/src/main/java/org/openas2/processor/receiver/MessageBuilderModule.java
+++ b/Server/src/main/java/org/openas2/processor/receiver/MessageBuilderModule.java
@@ -20,6 +20,7 @@
import org.openas2.processor.resender.ResenderModule;
import org.openas2.processor.sender.SenderModule;
import org.openas2.util.AS2Util;
+import org.openas2.util.IOUtil;
import javax.activation.DataHandler;
import javax.activation.DataSource;
@@ -62,23 +63,49 @@ protected CompositeParameters createParser(Message msg) {
}
- protected Message processDocument(InputStream ip, String filename) throws OpenAS2Exception, FileNotFoundException {
+ /**
+ * Move the file into the processing folder then invoke the sending process.
+ * @param fileToSend
+ * @param filename
+ * @return
+ * @throws OpenAS2Exception
+ * @throws FileNotFoundException
+ */
+ protected Message processDocument(File fileToSend, String filename) throws OpenAS2Exception, FileNotFoundException {
Message msg = buildMessageMetadata(filename);
+ File pendingFile = new File(msg.getAttribute(FileAttribute.MA_PENDINGFILE));
+ try {
+ IOUtil.moveFile(fileToSend, pendingFile, false);
+ } catch (IOException e) {
+ logger.error(": " + e.getMessage(), e);
+ throw new OpenAS2Exception("Failed to move the inbound file " + fileToSend.getPath() + " to the processing location " + pendingFile.getName());
+ }
+ return processDocument(pendingFile, msg);
+ }
- String pendingFile = msg.getAttribute(FileAttribute.MA_PENDINGFILE);
- // Persist the file that has been passed in
- File doc = new File(pendingFile);
+ /**
+ * Take the file input stream and write it to a file system file in the processing folder.
+ * Use this method if the file is produced in real time through a stream.
+ * @param ip
+ * @param filename
+ * @return
+ * @throws OpenAS2Exception
+ * @throws FileNotFoundException
+ */
+ protected Message processDocument(InputStream ip, String filename) throws OpenAS2Exception, FileNotFoundException {
+ Message msg = buildMessageMetadata(filename);
+ File pendingFile = new File(msg.getAttribute(FileAttribute.MA_PENDINGFILE));
FileOutputStream fo = null;
try {
- fo = new FileOutputStream(doc);
+ fo = new FileOutputStream(pendingFile);
} catch (FileNotFoundException e1) {
- throw new OpenAS2Exception("Could not create file in pending folder: " + pendingFile, e1);
+ throw new OpenAS2Exception("Could not create file in pending folder: " + pendingFile.getName(), e1);
}
try {
IOUtils.copy(ip, fo);
} catch (IOException e1) {
fo = null;
- throw new OpenAS2Exception("Could not write file to pending folder: " + pendingFile, e1);
+ throw new OpenAS2Exception("Could not write file to pending folder: " + pendingFile.getName(), e1);
}
try {
ip.close();
@@ -94,12 +121,11 @@ protected Message processDocument(InputStream ip, String filename) throws OpenAS
e1.printStackTrace();
}
fo = null;
+ return processDocument(pendingFile, msg);
+ }
- try {
- buildMessageData(msg, doc, null);
- } finally {
- doc = null;
- }
+ protected Message processDocument(File pendingFile, Message msg) throws OpenAS2Exception, FileNotFoundException {
+ buildMessageData(msg, pendingFile, null);
String customHeaderList = msg.getPartnership().getAttribute(Partnership.PA_CUSTOM_MIME_HEADER_NAMES_FROM_FILENAME);
if (customHeaderList != null && customHeaderList.length() > 0) {
String[] headerNames = customHeaderList.split("\\s*,\\s*");
@@ -107,6 +133,7 @@ protected Message processDocument(InputStream ip, String filename) throws OpenAS
if (logger.isTraceEnabled()) {
logger.trace("Adding custom headers based on message file name to custom headers map. Delimeters: " + delimiters + msg.getLogMsgID());
}
+ String filename = msg.getAttribute(FileAttribute.MA_FILENAME);
if (delimiters != null) {
// Extract the values based on delimiters which means the mime header names are
// prefixed with a target
@@ -146,11 +173,11 @@ protected Message processDocument(InputStream ip, String filename) throws OpenAS
}
}
if (logger.isInfoEnabled()) {
- logger.info("File assigned to message: " + filename + msg.getLogMsgID());
+ logger.info("File assigned to message: " + pendingFile.getName() + msg.getLogMsgID());
}
if (msg.getData() == null) {
- throw new InvalidMessageException("Failed to retrieve data for outbound AS2 message for file: " + filename);
+ throw new InvalidMessageException("Failed to retrieve data for outbound AS2 message for file: " + pendingFile.getName());
}
if (logger.isTraceEnabled()) {
logger.trace("PARTNERSHIP parms: " + msg.getPartnership().getAttributes() + msg.getLogMsgID());
@@ -171,6 +198,9 @@ protected Message processDocument(InputStream ip, String filename) throws OpenAS
msg.setStatus(Message.MSG_STATUS_MSG_SEND);
// Transmit the message
getSession().getProcessor().handle(SenderModule.DO_SEND, msg, options);
+ if (!msg.isConfiguredForAsynchMDN()) {
+ AS2Util.cleanupFiles(msg, false);
+ }
} catch (Exception e) {
msg.setLogMsg("Fatal error sending message: " + org.openas2.logging.Log.getExceptionMsg(e));
logger.error(msg, e);
diff --git a/Server/src/main/java/org/openas2/processor/receiver/NetModule.java b/Server/src/main/java/org/openas2/processor/receiver/NetModule.java
index 0f3652de..096e2d47 100644
--- a/Server/src/main/java/org/openas2/processor/receiver/NetModule.java
+++ b/Server/src/main/java/org/openas2/processor/receiver/NetModule.java
@@ -104,7 +104,7 @@ public boolean healthcheck(List failures) {
}
Map options = new HashMap();
options.put(HTTPUtil.HTTP_PROP_OVERRIDE_SSL_CHECKS, "true");
- ResponseWrapper rw = HTTPUtil.execRequest(HTTPUtil.Method.GET, urlString, null, null, null, options, 0L);
+ ResponseWrapper rw = HTTPUtil.execRequest(HTTPUtil.Method.GET, urlString, null, null, null, options, 0L, false);
if (200 != rw.getStatusCode()) {
failures.add(this.getClass().getSimpleName() + " - Error making HTTP connection. Response code: " + rw.getStatusCode() + " " + rw.getStatusPhrase());
return false;
diff --git a/Server/src/main/java/org/openas2/processor/sender/AS2SenderModule.java b/Server/src/main/java/org/openas2/processor/sender/AS2SenderModule.java
index 0a8bf797..6744a303 100644
--- a/Server/src/main/java/org/openas2/processor/sender/AS2SenderModule.java
+++ b/Server/src/main/java/org/openas2/processor/sender/AS2SenderModule.java
@@ -39,6 +39,7 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.io.ObjectOutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
@@ -58,13 +59,13 @@ public class AS2SenderModule extends HttpSenderModule implements HasSchedule {
/** TODO: Remove this when module config enforces setting the action so that the super method does all the work
*
*/
- public String getModuleAction() {
- String action = super.getModuleAction();
- if (action == null) {
- return SenderModule.DO_SEND;
- }
- return action;
- }
+ public String getModuleAction() {
+ String action = super.getModuleAction();
+ if (action == null) {
+ return SenderModule.DO_SEND;
+ }
+ return action;
+ }
public boolean canHandle(String action, Message msg, Map options) {
if (!super.canHandle(action, msg, options)) {
@@ -186,7 +187,8 @@ private void sendMessage(String url, Message msg, MimeBodyPart securedData) thro
httpOptions.put(HTTPUtil.PARAM_HTTP_USER, msg.getPartnership().getAttribute(HTTPUtil.PARAM_HTTP_USER));
httpOptions.put(HTTPUtil.PARAM_HTTP_PWD, msg.getPartnership().getAttribute(HTTPUtil.PARAM_HTTP_PWD));
long maxSize = msg.getPartnership().getNoChunkedMaxSize();
- ResponseWrapper resp = HTTPUtil.execRequest(HTTPUtil.Method.POST, url, ih.getAllHeaders(), null, securedData.getInputStream(), httpOptions, maxSize);
+ boolean preventChunking = msg.getPartnership().isPreventChunking(false);
+ ResponseWrapper resp = HTTPUtil.execRequest(HTTPUtil.Method.POST, url, ih, null, securedData.getInputStream(), httpOptions, maxSize, preventChunking);
if (logger.isInfoEnabled()) {
logger.info("Message sent and response received in " + resp.getTransferTimeMs() + "ms" + msg.getLogMsgID());
}
diff --git a/Server/src/main/java/org/openas2/processor/sender/MDNSenderModule.java b/Server/src/main/java/org/openas2/processor/sender/MDNSenderModule.java
index c70da9c9..e3069ad7 100644
--- a/Server/src/main/java/org/openas2/processor/sender/MDNSenderModule.java
+++ b/Server/src/main/java/org/openas2/processor/sender/MDNSenderModule.java
@@ -2,6 +2,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.http.protocol.HTTP;
import org.openas2.OpenAS2Exception;
import org.openas2.WrappedException;
import org.openas2.message.AS2Message;
@@ -156,9 +157,10 @@ private boolean sendAsyncMDN(MessageMDN mdn, String url, DispositionType disposi
throw new WrappedException(we);
}
byte[] data = dataOutputStream.toByteArray();
- // make sure to set the content-length header
- //mdn.setHeader("Content-Length", Integer.toString(data.length));
- ResponseWrapper resp = HTTPUtil.execRequest(HTTPUtil.Method.POST, url, mdn.getHeaders().getAllHeaders(), null, new ByteArrayInputStream(data), httpOptions, maxSize);
+ // make sure to set the content-length header to avoid transferring as chunked which some AS2 software implementations do not support
+ mdn.setHeader(HTTP.CONTENT_LEN, Integer.toString(data.length));
+ boolean preventChunking = msg.getPartnership().isPreventChunking(false);
+ ResponseWrapper resp = HTTPUtil.execRequest(HTTPUtil.Method.POST, url, mdn.getHeaders(), null, new ByteArrayInputStream(data), httpOptions, maxSize, preventChunking);
int respCode = resp.getStatusCode();
// Check the HTTP Response code
diff --git a/Server/src/main/java/org/openas2/util/HTTPUtil.java b/Server/src/main/java/org/openas2/util/HTTPUtil.java
index 1c679c2e..893766bb 100644
--- a/Server/src/main/java/org/openas2/util/HTTPUtil.java
+++ b/Server/src/main/java/org/openas2/util/HTTPUtil.java
@@ -17,6 +17,7 @@
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
+import org.apache.http.entity.AbstractHttpEntity;
import org.apache.http.entity.BufferedHttpEntity;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.InputStreamEntity;
@@ -27,6 +28,7 @@
import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
import org.apache.http.impl.conn.SystemDefaultRoutePlanner;
import org.apache.http.protocol.BasicHttpContext;
+import org.apache.http.protocol.HTTP;
import org.apache.http.ssl.SSLContexts;
import org.openas2.OpenAS2Exception;
import org.openas2.WrappedException;
@@ -144,8 +146,8 @@ public static byte[] readHTTP(InputStream inStream, OutputStream outStream, Inte
DataInputStream dataIn = new DataInputStream(in);
// Retrieve the message content
- if (headerCache.getHeader("Content-Length") == null) {
- String transfer_encoding = headerCache.getHeader("Transfer-Encoding", ",");
+ if (headerCache.getHeader(HTTP.CONTENT_LEN) == null) {
+ String transfer_encoding = headerCache.getHeader(HTTP.TRANSFER_ENCODING, ",");
if (transfer_encoding != null) {
if (transfer_encoding.replaceAll("\\s+", "").equalsIgnoreCase("chunked")) {
@@ -306,9 +308,10 @@ public static String[] readRequest(InputStream in) throws IOException {
* @return ResponseWrapper
* @throws Exception
*/
- public static ResponseWrapper execRequest(String method, String url, Enumeration headers, NameValuePair[] params, InputStream inputStream, Map options, long noChunkMaxSize) throws Exception {
+ public static ResponseWrapper execRequest(String method, String url, InternetHeaders headers, NameValuePair[] params, InputStream inputStream, Map options, long noChunkMaxSize, boolean preventChunking) throws Exception {
HttpClientBuilder httpBuilder = HttpClientBuilder.create();
+ //org.apache.http.protocol.RequestContent
URL urlObj = new URL(url);
/*
* httpClient is used for this request only,
@@ -325,6 +328,13 @@ public static ResponseWrapper execRequest(String method, String url, Enumeration
httpBuilder.setConnectionManager(new BasicHttpClientConnectionManager());
}
+ // Check if Content-Length was added and remove it so it as it is managed by the HttpRequest when processing the entity
+ long contentLength = -1; // Initialise as unknown
+ String[] contentLengthValues = headers==null?null:headers.getHeader(HTTP.CONTENT_LEN);
+ if (contentLengthValues != null && contentLengthValues.length > 0) {
+ contentLength = Long.parseLong(contentLengthValues[0]);
+ headers.removeHeader(HTTP.CONTENT_LEN);
+ }
RequestBuilder rb = getRequestBuilder(method, urlObj, params, headers);
RequestConfig.Builder rcBuilder = buildRequestConfig(options);
setProxyConfig(httpBuilder, rcBuilder, urlObj.getProtocol());
@@ -337,26 +347,33 @@ public static ResponseWrapper execRequest(String method, String url, Enumeration
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(httpUser, httpPwd));
httpBuilder.setDefaultCredentialsProvider(credentialsProvider);
}
-
if (inputStream != null) {
- if (noChunkMaxSize > 0L) {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- long copied = IOUtils.copyLarge(inputStream, bout, 0L, noChunkMaxSize + 1, new byte[8192]);
- if (copied > noChunkMaxSize) {
- throw new IOException("Mime inputstream too big to put in memory (more than " + noChunkMaxSize + " bytes).");
+ AbstractHttpEntity httpEntity = new InputStreamEntity(inputStream, contentLength);
+ // the default is to use chunking for transfer encoding - allow override
+ if (preventChunking) {
+ if (noChunkMaxSize > 0L) {
+ // There is a maximum size of the content that a partner receiver can accept
+ if (contentLength == -1) {
+ // Not set as a header so do it the compute expensive way
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ contentLength = IOUtils.copyLarge(inputStream, bout, 0L, noChunkMaxSize + 1, new byte[8192]);
+ if (contentLength > noChunkMaxSize) {
+ throw new IOException("Data inputstream too big to put in memory (more than " + noChunkMaxSize + " bytes).");
+ }
+ httpEntity = new ByteArrayEntity(bout.toByteArray(), null);
+ }
}
- ByteArrayEntity bae = new ByteArrayEntity(bout.toByteArray(), null);
- rb.setEntity(bae);
+ // Tell the HTTP client to try to send unchunked - the Content-Length will be extracted from the entity
+ httpEntity.setChunked(false);
+ }
+ // Use a BufferedEntity for BasicAuth connections to avoid the NonRepeatableRequestException
+ if (httpUser != null) {
+ rb.setEntity(new BufferedHttpEntity(httpEntity));
} else {
- InputStreamEntity ise = new InputStreamEntity(inputStream);
- // Use a BufferedEntity for BasicAuth connections to avoid the NonRepeatableRequestExceotion
- if (httpUser != null) {
- rb.setEntity(new BufferedHttpEntity(ise));
- } else {
- rb.setEntity(ise);
- }
+ rb.setEntity(httpEntity);
}
}
+
final HttpUriRequest request = rb.build();
BasicHttpContext localcontext = new BasicHttpContext();
@@ -413,7 +430,7 @@ public boolean verify(String hostname, SSLSession session) {
return sslsf;
}
- private static RequestBuilder getRequestBuilder(String method, URL urlObj, NameValuePair[] params, Enumeration headers) throws URISyntaxException {
+ private static RequestBuilder getRequestBuilder(String method, URL urlObj, NameValuePair[] params, InternetHeaders headers) throws URISyntaxException {
RequestBuilder req = null;
if (method == null || method.equalsIgnoreCase(Method.GET)) {
@@ -438,8 +455,9 @@ private static RequestBuilder getRequestBuilder(String method, URL urlObj, NameV
}
if (headers != null) {
boolean removeHeaderFolding = "true".equals(Properties.getProperty(HTTP_PROP_REMOVE_HEADER_FOLDING, "true"));
- while (headers.hasMoreElements()) {
- Header header = headers.nextElement();
+ Enumeration headerEnum = headers.getAllHeaders();
+ while (headerEnum.hasMoreElements()) {
+ Header header = headerEnum.nextElement();
String headerValue = header.getValue();
if (removeHeaderFolding) {
headerValue = headerValue.replaceAll("\r\n[ \t]*", " ");
diff --git a/changes.txt b/changes.txt
index 9d857641..c7723e52 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,3 +1,10 @@
+Version 3.2.0 - 2022-06-21
+This is a minor enhancement and bugfix release:
+ **IMPORTANT NOTE**: Please review upgrade notes in the RELEASE-NOTES.md if you are upgrading
+
+ 1. Support "prevent_chunking" attribute on partnership to support older AS2 systems.
+ 2. Fix copying the sent file to the sent folder when successfully sent.
+
Version 3.1.0 - 2022-06-04
This is a minor enhancement and bugfix release:
**IMPORTANT NOTE**: Please review upgrade notes in the RELEASE-NOTES.md if you are upgrading
diff --git a/docs/OpenAS2HowTo.odt b/docs/OpenAS2HowTo.odt
index 8c856c0c..52dfbf03 100644
Binary files a/docs/OpenAS2HowTo.odt and b/docs/OpenAS2HowTo.odt differ
diff --git a/docs/OpenAS2HowTo.pdf b/docs/OpenAS2HowTo.pdf
index 82c96053..fd1d9cec 100644
Binary files a/docs/OpenAS2HowTo.pdf and b/docs/OpenAS2HowTo.pdf differ
diff --git a/pom.xml b/pom.xml
index 6cb47cb9..5f2dc00f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
4.0.0
net.sf.openas2
OpenAS2
- 3.1.0
+ 3.2.0
OpenAS2
pom
@@ -97,7 +97,7 @@
com.h2database
h2
- 2.1.212
+ 2.1.214
@@ -133,7 +133,7 @@
org.mockito
mockito-core
- 4.6.0
+ 4.6.1
test
@@ -157,7 +157,7 @@
org.glassfish.jersey.containers
jersey-container-grizzly2-http
- 3.1.0-M2
+ 3.1.0-M3
jar
@@ -169,13 +169,13 @@
org.glassfish.jersey.media
jersey-media-json-jackson
- 3.1.0-M2
+ 3.1.0-M3
jar
org.glassfish.jersey.inject
jersey-hk2
- 3.1.0-M2
+ 3.1.0-M3
@@ -186,17 +186,17 @@
com.sun.xml.bind
jaxb-core
- 4.0.0-M4
+ 4.0.0
com.sun.xml.bind
jaxb-impl
- 4.0.0-M4
+ 4.0.0
io.sentry
sentry
- 5.7.4
+ 6.1.2