Set correct length and content type
Merge remote-tracking branch 'upstream/master' into wip-web-client