TinCanJS icon indicating copy to clipboard operation
TinCanJS copied to clipboard

Content-Length should be a form parameter for IE mode requests

Open garemoko opened this issue 10 years ago • 2 comments

See https://github.com/adlnet/xAPI-Spec/pull/566

garemoko avatar Dec 30 '14 19:12 garemoko

I don't think there is any change needed here for this request. If the client is using a 'Content-Length' header then it was explicitly set since the library itself doesn't ever set it automatically. In that case the library will automatically shove all headers it isn't doing itself into the form encoded body, and then the browser may add the actual request content length automatically, which is still within spec.

brianjmiller avatar Nov 12 '15 20:11 brianjmiller

My understanding is that we should always be sending a content length header. This is something that is not a MUST, but is encouraged in 1.0.3 and very loosely implied in earlier versions (you explicitly MAY omit Content-Length in HEAD requests).

It doesn't generally matter that TinCanJS doesn't add a content-length header for normal requests because the browser adds it (I think all the main ones do?). It's more important for alt syntax requests because those never add the content length form parameter.

A complete solution would also ensure we're not relying on the browser adding the header too.

garemoko avatar Nov 12 '15 20:11 garemoko