Skip to content

Commit

Permalink
Make worker JSON protocol properly ignore unknown fields.
Browse files Browse the repository at this point in the history
RELNOTES: None.
PiperOrigin-RevId: 381428739
  • Loading branch information
larsrc-google committed Jul 30, 2021
1 parent e360bf8 commit 9f7e57a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ private static ImmutableList<Input> readInputs(JsonReader reader) throws IOExcep
path = reader.nextString();
break;
default:
continue;
// As per https://docs.bazel.build/versions/main/creating-workers.html#work-responses,
// unknown fields are ignored.
reader.skipValue();
break;
}
}
reader.endObject();
Expand Down Expand Up @@ -125,6 +128,9 @@ public WorkRequest readWorkRequest() throws IOException {
requestId = reader.nextInt();
break;
default:
// As per https://docs.bazel.build/versions/main/creating-workers.html#work-responses,
// unknown fields are ignored.
reader.skipValue();
break;
}
}
Expand Down

0 comments on commit 9f7e57a

Please sign in to comment.