Allow file uploads of any size and better report active cameras in PhotonCamera error print (#1298)

Previously reported itself which was confusing. New print:

```
Error at org.photonvision.PhotonCamera.verifyVersion(PhotonCamera.java:378): Found the following PhotonVision cameras active on NetworkTables:
 ==> HD_Pro_Webcam_C920
 ==> Arducam_OV9281_USB_Camera
```
This commit is contained in:
Matt
2024-05-10 14:58:18 -04:00
committed by GitHub
parent 1708376df8
commit 713fad6f6b
6 changed files with 76 additions and 27 deletions

View File

@@ -65,10 +65,6 @@ public class Server {
corsContainer.add(CorsPluginConfig::anyHost);
});
// Increase the upload size limit (arbitrary, but need to be able to deal with large
// calibration JSONs)
javalinConfig.http.maxRequestSize = (long) (50 * 1e6);
javalinConfig.requestLogger.http(
(ctx, ms) -> {
StringJoiner joiner =
@@ -77,6 +73,12 @@ public class Server {
.add(ctx.req().getMethod())
.add("from endpoint")
.add(ctx.path())
.add("of req size")
.add(Integer.toString(ctx.contentLength()))
.add("bytes & type")
.add(ctx.contentType())
.add("with return code")
.add(Integer.toString(ctx.res().getStatus()))
.add("for host")
.add(ctx.req().getRemoteHost())
.add("in")