So far this (these) seem to be the best possible solutions. Others seem to agree.
I'd most be interested in the first choice.
The 'work' script has a content-type of text/plain. I'm not sure how to go about adjusting STDOUT but this seems to be on the right track.