Where does the expression "cod indignation" originate from?

Among the meanings of cod listed in Eric Partridge, A Dictionary of Slang and Unconventional English, eighth edition (1984) is this one:

cod, adj. Burlesque; esp. cod acting, as in acting a Victorian melodrama as though it were a post-1918 farce or burlesque: actors': from ca. 1890. Since ca. 1965 it has been used as coll. for 'pretence or mock', e.g., cod German, cod Russian.

The related verb form has its own entry in Partridge:

cod, v. To chaff; hoax: humbug; play the fool: v.t. and i.: from ca. 1870.

So "cod indignation" means false, simulated, play-acted, or grossly exaggerated indignation. Both of the OP's examples readily admit this interpretation.

John Ayto and John Simpson, The Oxford Dictionary of Modern Slang (1992) has a couple of seemingly related entries:

cod noun Also cod's, cods. Brit Abbreviation of CODSWALLOP noun 1963—. [Example:] M. Tripp If you think its all a load of cod's why the hell waste a pound? (1970).

codswallop noun Brit Nonsense. 1963—. [Example:] A. Prior All that stuff about mutual respect between police and criminal was a load of old codswallop (1966). {Origin unknown, despite popular theories of a Mr. Cod and his beer.}

The common element in all of these definitions is the insincerity of the presentation, assertion, or associated emotion.


Of the earlier slang meanings of the noun cod identified in Partridge—which include "scrotum," "testicle," "purse," "friend," "pensioner of the Charterhouse," "drunkard," and "foreman"—the likeliest source of the relevant adjective form is this one:

cod. ... 4. A fool: from ca. 1690; ob[solescent] Perhaps ex cod's head, also a fool: B.E. has both.


Informal British English accepts fake is an alternate definition of cod:

adjective

Not authentic; fake:

ODO

The etymology of this use is not certain, but according to The Word Detective:

“Cod” meaning “phony” has been British slang since the early 20th century, and although “cod” to me immediately conjures up visions of fish and chips, the connection of this “cod” to that is open to question. “Cod,” apart from fishy uses, has actually been slang since the late 17th century, but its original sense (for our purposes here) was to mean “fellow” (especially an old man) or, a bit more pungently, “fool” (“Ye vile drunken cod,” 1878). Some authorities have proposed that this “cod” was actually short for “codger,” meaning “a stingy and/or peculiar old man.” But apparently “cod” in this sense is found in the written record earlier than “codger,” so that explanation is considered dubious (although not impossible, given the spotty nature of the written record in that period).


The bombastic style of the late 16th century was described as pease-cod bellied :

a[dj].

Having the lower part projecting and stiffly quilted and bombasted: said of the doublet fashionable at the end of the sixteenth century.

enter image description here

That peasecod image invites fake to the imagination, and although there is no clear linguistic evidence, the appearance of the codpiece also leaves plenty of room in the imagination for fake sack:

enter image description here

Sack is one of the archaic definitions of cod, from The New and Complete Dictionary of the English Language by John Ash of 1775:

The membrane and bag that contains the testes.

The definition of peasecod cuirass, fashioned on the peasecod bellied doublet, offers an interesting cultural insight:

Breastplates of this fashion were worn until the change of costume cause by the active prosecution of the religious wars, when these fantastic forms gave way to others, plainer and more practical.

Although there seems to be no hard linguistic proof, it is quite possible that the pretentious attitude behind this "baggy style" carried cod down the same metaphorical path as bombast:

1560s, "cotton padding," corrupted from earlier bombace (1550s), from Old French bombace "cotton, cotton wadding,"
from Late Latin bombacem, accusative of bombax "cotton, 'linteorum aut aliae quaevis quisquiliae,' " a corruption and transferred use of Latin bombyx "silk,"
from Greek bombyx "silk, silkworm" (which also came to mean "cotton" in Medieval Greek),
from some oriental word, perhaps related to Iranian pambak (modern panba) or Armenian bambok,
perhaps ultimately from a PIE root meaning "to twist, wind."
From stuffing and padding for clothes or upholstery, meaning extended to "pompous, empty speech" (1580s).

A fellow of the "fake sack" style is an ostentatious fool? William Shakespeare seems to add credence to that possibility in King Lear. While confronting Lear's folly in the image of a cod-piece, the Fool compares Kent to grace and a wise man, while comparing Lear to a cod-piece and a fool:

Fool
25 He that has a house to put's head in has a good
26 head-piece
27 The cod-piece that will house
28 Before the head has any,
29 The head and he shall louse;
30 So beggars marry many.
31 The man that makes his toe
32 What he his heart should make
33 Shall of a corn cry woe,
34 And turn his sleep to wake.
35 For there was never yet fair woman but she made
36 mouths in a glass.

KING LEAR
37 No, I will be the pattern of all patience;
38 I will say nothing.

KENT
39 Who's there?

Fool
40 Marry, here's grace and a cod-piece; that's a wise man and a fool.

King Lear : Act 3, Scene 2
Emphasis mine

In 1867, Alexander Dyce's The Works of William Shakespeare: Preface. Addenda, offered a different, but equally compelling, interpretation of the cod-piece:

an ostentatiously indelicate part of the male dress, which was put to several uses,—to stick pins in, to carry the purse in, &c. i. 290 (twice), 486; 112; iii. 483; vii. 295 (twice) ; (on the last of which passages, Marry, here's grace and a cod-piece ; that's a wise man and a fool, Douce observes, “Shakespeare has with some humour, applied the above name [cod-piece] to the Fool, who, for obvious reasons, was usually provided with this unseemly part of dress in a more remarkable manner than other persons”)

Whether the Fool refers to Lear or to himself as a cod-piece and a fool, Shakespeare has opened the door for cod:

a foolish man with a sack emptier than it appears to be.