You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to improve testability and also support knative using our runtimes, we should implement input and interpret the output of a web action directly in the proxy.
So if we invoke the proxy at the root: (http://localhost:8080/) it should work like /run but we should pass the parameters __ow_* as defined in the spec and then interpret the output according the webactions spec. For example if an action returns:
{
"body": "<h1>hello</h1>"
}
it should NOT return the json but actually <h1>hello</h1>, with an appropriate content type (default text/html).
We should also implement the other fields. For example invoking http://localhost:8080/ for this aswer
when the content type starts with image/ should decode the body as base64 encoded.
OpenWhisk also allow for setting the content tye extensions, so we should add the ability to use /index.html to returnthe body with default content-type text/html, while index.json will use content-type: application/json, index.txt returns text/plain, index.png and index.jpg returns image/png and image/jpeg.
The text was updated successfully, but these errors were encountered:
francescotimperi
changed the title
Impleement the webactions at the proxy runtime level
Implement the webactions at the proxy runtime level
Oct 30, 2024
Currently the go proxy for runtimes does not answer in port 8080 at the root level (the answer is empty). It answer to /run and returns a json.
The output for webactions is defined by this spec
In order to improve testability and also support knative using our runtimes, we should implement input and interpret the output of a web action directly in the proxy.
So if we invoke the proxy at the root: (
http://localhost:8080/
) it should work like/run
but we should pass the parameters__ow_*
as defined in the spec and then interpret the output according the webactions spec. For example if an action returns:it should NOT return the json but actually
<h1>hello</h1>
, with an appropriate content type (defaulttext/html
).We should also implement the other fields. For example invoking http://localhost:8080/ for this aswer
will return an empty body with status coden 307 and the header Location to implement a redirect.
Finally we should support images:
the answer:
when the content type starts with
image/
should decode the body as base64 encoded.OpenWhisk also allow for setting the content tye extensions, so we should add the ability to use
/index.html
to returnthe body with default content-typetext/html
, whileindex.json
will usecontent-type: application/json
,index.txt
returnstext/plain
,index.png
andindex.jpg
returnsimage/png
andimage/jpeg
.The text was updated successfully, but these errors were encountered: