Does Google Cloud Run allow non-standard HTTP methods?

79 views Asked by At

I created a HTTP API on that uses the non-standard QUERY method. It works fine locally but on Google Cloud Run, every QUERY request gets a 502 response. Making the exact same request with POST works fine.

Is it possible that Cloud Run doesn't allow non-standard HTTP methods? I couldn't find anything about that in the documentation.

curl 'https://***-ey.a.run.app/***' -X 'QUERY' --data-binary '@/Users/jfhr/Downloads/10052066.pdf' -H 'content-type: application/pdf' --verbose --output -
*   Trying [2001:4860:4802:32::35]:443...
* Connected to ***-ey.a.run.app (2001:4860:4802:32::35) port 443 (#0)
* ALPN: offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=*.a.run.app
*  start date: Sep  4 08:16:44 2023 GMT
*  expire date: Nov 27 08:16:43 2023 GMT
*  subjectAltName: host "***-ey.a.run.app" matched cert's "*.a.run.app"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
*  SSL certificate verify ok.
* using HTTP/2
* h2 [:method: QUERY]
* h2 [:scheme: https]
* h2 [:authority: ***-ey.a.run.app]
* h2 [:path: /***]
* h2 [user-agent: curl/8.1.2]
* h2 [accept: */*]
* h2 [content-type: application/pdf]
* h2 [content-length: 92666]
* Using Stream ID: 1 (easy handle 0x124014000)
> QUERY /*** HTTP/2
> Host: ***-ey.a.run.app
> User-Agent: curl/8.1.2
> Accept: */*
> content-type: application/pdf
> Content-Length: 92666
> 
* We are completely uploaded and fine
< HTTP/2 502 
< content-type: text/html; charset=UTF-8
< referrer-policy: no-referrer
< content-length: 332
< date: Sun, 24 Sep 2023 19:45:27 GMT
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
< 

<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>
0

There are 0 answers