NIAD-3252: External attachment filename containing equals sign throws exception#198
Merged
MartinWheelerMT merged 8 commits intomainfrom Dec 13, 2024
Merged
Conversation
6939b5d to
d120571
Compare
70512f1 to
2e36a73
Compare
41aeef0 to
e0760f6
Compare
e0760f6 to
e1e5e37
Compare
adrianclay
reviewed
Dec 12, 2024
adrianclay
reviewed
Dec 12, 2024
36395a9 to
cdc91a8
Compare
181a2c5 to
6a82af3
Compare
…educe duplication. Inline xml into the above method, and remove previously added xml file. Add test to ensure that `title` is none when the description does not contain a filename. Add test to ensure that title is set to none if case-sensitive 'Filename' is not provided as a key. Add test to ensure that title is not set, but attachment is still handled when a description does not contain key value pairs. Add test to ensure that the adaptor hands duplicated `Filename` keys by using the value from the last key. Add functionality to ebxml_envelope so that a check is completed on each description variable to ensure that it is a valid key value pair (`key=value`).
adrianclay
approved these changes
Dec 13, 2024
Contributor
adrianclay
left a comment
There was a problem hiding this comment.
Minor feedback is that grouping the tests related to filenames under a common class might make it a bit more readable. May be easier to chat through my thinking though.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Updated the code using the split command in
ebxml_envelope.pyso that it only splits on the first occurence of=so that the full filename used and not attempted to be split further if it contains an=. This was also updated to not attempt to a process a provided variable if it is not a valid key value pairHave also added tests to handle the following cases for the description:
<eb:Description>This isn't a GP2GP message</eb:Description><eb:Description>Filename=Value Filename=Value2</eb:Description>filename:<eb:Description>FILENAME=Value Filename=Value2</eb:Description>Why
If an attachment filename contains an equals sign (such as in the example below) then a error is currently thrown. This should be handled that a filename with an equals sign does not cause an issue.
Also, from discussion, the following checks were required to make sure the adaptor throw errors in the following cases:
<eb:Description>This isn't a GP2GP message</eb:Description><eb:Description>Filename=Value Filename=Value2</eb:Description>filename:<eb:Description>FILENAME=Value Filename=Value2</eb:Description>Type of change
Please delete options that are not relevant.
Checklist: