Skip to content

Commit 9d62700

Browse files
committed
Revert content type following PR337 discussion.
1 parent 6621414 commit 9d62700

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

corim/signedcorim.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import (
1616
)
1717

1818
var (
19-
ContentType = "application/corim-unsigned+cbor"
20-
oldContentType = "application/rim+cbor"
19+
ContentType = "application/rim+cbor"
2120
NoExternalData = []byte("")
2221
HeaderLabelCorimMeta = int64(8)
2322
)
@@ -65,11 +64,6 @@ func (o *SignedCorim) processHdrs() error {
6564
return errors.New("missing mandatory content type")
6665
}
6766

68-
// Compatibility step from older spec draft
69-
if v == oldContentType {
70-
v = ContentType
71-
}
72-
7367
if v != ContentType {
7468
return fmt.Errorf("expecting content type %q, got %q instead", ContentType, v)
7569
}

corim/signedcorim_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func TestSignedCorim_FromCOSE_fail_corim_bad_cbor(t *testing.T) {
285285
[
286286
/ protected / << {
287287
/ alg / 1: -7, / ECDSA 256 /
288-
/ content-type / 3: "application/corim-unsigned+cbor",
288+
/ content-type / 3: "application/rim+cbor",
289289
/ corim-meta / 8: h'a200a1006941434d45204c74642e01a101c11a5fad2056'
290290
} >>,
291291
/ unprotected / {},
@@ -315,7 +315,7 @@ func TestSignedCorim_FromCOSE_fail_invalid_corim(t *testing.T) {
315315
[
316316
/ protected / << {
317317
/ alg / 1: -7, / ECDSA 256 /
318-
/ content-type / 3: "application/corim-unsigned+cbor",
318+
/ content-type / 3: "application/rim+cbor",
319319
/ corim-meta / 8: h'a200a1006941434d45204c74642e01a101c11a5fad2056'
320320
} >>,
321321
/ unprotected / {},
@@ -396,7 +396,7 @@ func TestSignedCorim_FromCOSE_fail_unexpected_content_type(t *testing.T) {
396396
var actual SignedCorim
397397
err := actual.FromCOSE(tv)
398398

399-
assert.EqualError(t, err, `processing COSE headers: expecting content type "application/corim-unsigned+cbor", got "application/cbor" instead`)
399+
assert.EqualError(t, err, `processing COSE headers: expecting content type "application/rim+cbor", got "application/cbor" instead`)
400400
}
401401

402402
func unsignedCorimFromCBOR(t *testing.T, cbor []byte) *UnsignedCorim {

0 commit comments

Comments
 (0)