Repository navigation
Send one Evidence name once, whatever its letter case, by precedence - #107
Merged
Merged
Conversation
…dence Evidence keys ignore letter case, so header.User-Agent and query.user-agent name one field, which is sent once with the name and value of the key that wins by the precedence in evidence.md: query, header, cookie, server, fiftyone and location, then any other prefix alphabetically.
Evidence keys ignore letter case, so the form fields are now keyed without regard to case. One name under two prefixes, such as header.User-Agent and query.user-agent, is sent once, with the name and value of the key that wins, where before both were sent. The other prefixes now follow evidence.md's order, being server, fiftyone and location, then any other prefix alphabetically, where before server, fiftyone and location were ranked alphabetically among the rest.
This was referenced Nov 11, 2026
Merged
ab.value ranks before ab-c.Value, because the prefix ab sorts before ab-c, where comparing the whole key put ab-c first, as a hyphen sorts before a dot. _x ranks before a, as the prefixes compare in lower case.
Two keys under other prefixes were ordered by the whole key, so ab-c.n ranked before ab.n because a hyphen sorts before a dot. evidence.md ranks prefixes, so the prefixes are compared, in lower case as Go, Node, PHP and Python compare them, and the whole key only breaks a tie.
jwrosewell
marked this pull request as ready for review
November 11, 2026 20:26
This was referenced Nov 11, 2026
Merged
Merged
Use the standard licence text in one LICENSE, and take the schema from configuration-validation
#109
Merged
Draft
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.
The problem
The Cloud Request Engine sends each Evidence value under its key with the prefix removed, and resolves a clash between prefixes by precedence. It kept the form fields in a
HashMap, which compares names by their exact letters, so one name given in two letter cases under two prefixes, such asheader.User-Agentandquery.user-agent, became two fields,User-Agentanduser-agent, and both were sent. The cloud service then got two values for one field with no way to know which applied.The other prefixes were also ranked by their spelling alone, so
fiftyonebeatlocation, which beatserver, where the specification ranksserverfirst.What the specification says
evidence.md at e89679e9:
The prefixes are listed as
query,header,cookie,server,fiftyoneandlocation, and then:cloud-request-engine.md, Processing, at e89679e9:
What changes
In
pipeline/pipeline.cloudrequestengine/src/main/java/fiftyone/pipeline/cloudrequestengine/flowelements/CloudRequestEngineDefault.java:getFormDatakeeps the form fields in aTreeMapordered byString.CASE_INSENSITIVE_ORDER, so one name in two letter cases is one field.addFormDataremoves the old field and puts the new one, so the name sent is the winning key's as well as its value. A name with no clash is sent as it was given, as before.addFormDataorders the keys it adds lowest precedence first by the newotherPrefixRank, beingserver,fiftyoneandlocationas evidence.md lists them, then any other prefix alphabetically, where before it ordered them by key alone. The conflict warning now finds conflicting keys without regard to case.ab-c.nbeforeab.n, because a hyphen sorts before a dot.Python, since 51degrees-python#99, and Go already send a name once by this precedence. Python also compares two other prefixes the same way, by the prefix in lower case and then by the whole key (
other_prefix_rankincloudrequestengine.py), and Go compares the prefixes in lower case. .NET has the same fault as Java, fixed in 51degrees-dotnet#136.Behaviour that changes for callers
server,fiftyoneandlocationnow sends theservervalue overfiftyone, andfiftyoneoverlocation. These clashes are rare, as those prefixes carry different names in practice.How it was checked
getFormData_OneNameInTwoCases_SentOnceByPrecedenceinCloudRequestEngineTests.javaadds two Evidence values and reads the form data the engine builds. It needs exactly one field of that name, ignoring case, with the winner's name and value, for the same ten rows as .NET:headeragainstqueryboth ways round,cookieagainstheader,locationagainstserver,locationagainstfiftyone,fiftyoneagainstserver,serveragainst an unknown prefix, two unknown prefixes,abagainstab-c, and_xagainsta.Each test run is a throwaway branch with a temporary workflow running
CloudRequestEngineTestson Ubuntu for Java 8 and 21.rc(9170cab){User-Agent=A, user-agent=B}. The other 38 tests passab-c.Valueagainstab.valuerow. The_xrow passes already, becauseString.CASE_INSENSITIVE_ORDERcompares in lower casercat 528e0df. All 9 jobs without macOS passed, being Ubuntu Java 8, 11, 17 and 21, Ubuntu ARM Java 17, and Windows Java 8, 11, 17 and 21. EverySetting 'PullRequestSha'line, in Configure and in each of the 9 jobs, is 2904873, and Configure printed "Left out 6 macOS entries". The first attempt failed on Ubuntu Java 11 whenJavaScriptBuilderTests.Inittimed out starting the browser, a test this draft does not touch, and the second attempt passedmacOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.
Every exit path of
getFormData,addFormDataandotherPrefixRankwas read after the change.What remains
CloudRequestEngineDefault.javaas well, at other lines, so whichever merges second mergesrcagain.Version
No version change.