Bug: gist creation API fails with HTTP 502 Server Error if given sufficiently large file

e.g.:

$ dd if=/dev/urandom count=100000 | base64 | jq -Rs '{"description": "test", "public": false, "files": {"test.b64": {"content": .}}}' - | curl --user "Krenair" -X POST -H "Accept: application/vnd.github.v3+json" -v --data @- https://api.github.com/gists
100000+0 records in
100000+0 records out
51200000 bytes transferred in 2.058347 secs (24874329 bytes/sec)
Enter host password for user 'Krenair':
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 140.82.121.6...
* TCP_NODELAY set
* Connected to api.github.com (140.82.121.6) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=*.github.com
*  start date: Mar 25 00:00:00 2021 GMT
*  expire date: Mar 30 23:59:59 2022 GMT
*  subjectAltName: host "api.github.com" matched cert's "*.github.com"
*  issuer: C=US; O=DigiCert, Inc.; CN=DigiCert High Assurance TLS Hybrid ECC SHA256 2020 CA1
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Server auth using Basic with user 'Krenair'
* Using Stream ID: 1 (easy handle 0x7fd6e4001600)
> POST /gists HTTP/2
> Host: api.github.com
> Authorization: Basic redacted
> User-Agent: curl/7.54.0
> Accept: application/vnd.github.v3+json
> Content-Length: 68266770
> Content-Type: application/x-www-form-urlencoded
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
* We are completely uploaded and fine
< HTTP/2 502
< server: GitHub.com
< date: Thu, 01 Apr 2021 10:15:06 GMT
< content-type: application/json
< content-length: 32
< etag: "6065967d-20"
< vary: Accept-Encoding, Accept, X-Requested-With
< x-github-request-id: 4EE3:D14D:BA0A:145D3:60659CDA
<
{
  "message": "Server Error"
}