Skip to content

Commit

Permalink
makeKey Add restriction for : (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
prayansh authored Apr 28, 2021
1 parent 29f7629 commit 0e66f3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private static void putValue(Bundle bundle, String key, Object value) {
}

public static String makeKey(String key) {
String[] forbiddenChars = {".", "-", " "};
String[] forbiddenChars = {".", "-", " ", ":"};
for (String forbidden : forbiddenChars) {
if (key.contains(forbidden)) {
key = key.trim().replace(forbidden, "_");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ public void makeKeyWithDashAndDot() {
verify(firebase).logEvent(eq("test_event_dashed_and_dotted"), bundleEq(new Bundle()));
}

@Test
public void makeKeyWithColon() {
integration.track(new TrackPayload.Builder().anonymousId("12345").event("test:colon").build());
verify(firebase).logEvent(eq("test_colon"), bundleEq(new Bundle()));
}

/**
* Uses the string representation of the object. Useful for JSON objects.
* @param expected Expected object
Expand Down

0 comments on commit 0e66f3e

Please sign in to comment.