1.
walking right into danger; a moth to the flame
A proverb: like a summer insect that flies into a fire, someone who walks of their own accord into danger or ruin. Often said, with a sneer, of an enemy or rival who comes straight to where one is waiting.
まさに飛んで火に入る夏の虫だ。
He's walked right into it.
Literally "the summer insect that flies into the fire": on summer nights, moths and other insects drawn to lamps and bonfires burn themselves. It is used both as a warning and, in dramas and manga, as a villain's taunt when the hero arrives: 飛んで火に入る夏の虫とはお前のことだ.
Usage
It describes the person, so it is said of someone, usually not of oneself, and often follows とは or なんて, as in the examples.