Skip to content

Content-Range is badly formatted

GitLab Runner uses PATCH endpoint to send incremental traces to GitLab.

However, it does not follow the Content-Range specification which is: byte_start-byte_end.

Instead, byte_end is byte_start+length where it should point at the last byte.

It means that when Content-Range: 0-0 is send by runner does not represent that runner wants to upload 1 byte, but instead it indicates that it wants to upload 0 bytes.

It simply means that the implementation is wrong, as it should be:

contentRange := fmt.Sprintf("%d-%d", tracePatch.Offset(), tracePatch.Limit() - 1)