Change handling of Content-Disposition for application/xml in REST integration #15451
sdsys-ch
started this conversation in
Contribute/Developers/Plugins
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have an https endpoint that returns
application/xml
but also sets theContent-Disposition: attachment
-header server-side.Budibase saves the result of the REST-datasource query to a temporary file and returns e.g.:
I've tried setting
Accept
orContent-Type
-type headers and debugged with curl on the cli, but no header on our side will modify the response headers.There's also no documented way to
&download=false
or similar API-side. Short of proxying the request and modifying the headers there or asking the API devs:Looking at the code base, rest.ts#L158 leads to
contentDisposition.includes("attachment")
returning true, overriding further handling in rest.ts#L194.Maybe an override switch similar to image handling could be added at REST datasource config level?
The goal is to have the XML in
data
for further processing via transformer/... vs. saving to local tmp-file.Would sth like:
ignoreXmlDisposition
to the rest integration schema:getAttachmentHeaders()
getAttachmentHeaders()
function in restUtil.ts similar to this:be an option?
This would be opt-in and limited to XML files while being non-breaking as well?
It could well be extended to
application/json
or text, but I haven't encountered an API that sets a disposition header for those, yet.If this handling is an option, I can submit a pull request. Pointers welcome if I'm missing sth!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions