-
Couldn't load subscription status.
- Fork 155
Pull Request for #485: Provide an option to disable the quotes for the filename at the content-disposition header #486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…at the content-disposition header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR - it works as expected for me.
To add a test for this, make a copy of the Server/src/test/java/org/openas2/message/DynamicContentTypeTest.java test class and strip out all the stuff related to content-type testing and insert your code to test content-disposition instead.
That test class sets up a simple AS2 message (simpleTestMsg) and provides you access to a poller (this.poller).
You can set the partnership attribute using this:
simpleTestMsg.getPartnership().setAttribute(Partnership.PA_QUOTE_SEND_FILE_NAME , "false");
Then you can simply invoke the "setAdditionalMetaData" method in the MessageBuilderModule class from the poller:
MimeBodyPart body = new MimeBodyPart();
this.poller.setAdditionalMetaData(simpleTestMsg, body);
You can then check what the content disposition looks like using this:
this.simpleTestMsg.getContentDisposition()
RELEASE-NOTES.md
Outdated
| <module classname="org.openas2.processor.receiver.AS2DirectoryPollingModule" | ||
| ... | ||
| sendfilename="true" | ||
| /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer how the poller works by default. It is only true if you want to use the generic poller that supports identifying the partnership credentials based on the file name.
Sending the file name is controlled by the system property in the config.xml:
pollerConfigBase.sendfilename="true"
The recommended approach to changing it is to set the property in a properties file that is configured to override the config.xml property defaults.
Or it can be overridden on a per partner basis in the partnerships.xml file in the pollerConfig element:
<pollerConfig enabled="true" sendfilename="true"/>
Server/src/config/partnerships.xml
Outdated
| --> | ||
| <!-- | ||
| Example for disabling the quoting of the sent filename at partnership-level. | ||
| Works only in combination with sendfilename="true" at module-level of AS2DirectoryPollingModule in config.xml. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as earlier comment about how the sendfilename attribute is used.
|
@uhurusurfa : I added a test and updated the documentation. Please have a look. I noticed some failing tests too [ERROR] RestApiTest.start_A_Server:84 org.openas2.WrappedException: Error creating component: org.openas2.cmd.processor.RestCommandProcessor But I guess that has nothing to do with my change. |
|
I have checked the maven log from your PR CI?CD run in Github and the RestApi test is passing so their may be an issue on your local system with that test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 - thanks, nice work.
See #485
Sorry, I was not able to write a test for this change. I played around in org.openas2.app.OpenAS2ServerTest#verifyMessageDelivery but I had no access to the
msgheadersdirectory. There was no getter in TestPartner nor TestMessage to access the file with the header information which I liked to check.So I tested manually and it was successful. (I used a internal config.xml and partnership.xml which I am not allowed to share, but you get the idea how it works)