Disclosed is a heat exchanger (1) comprising a housing (2) in which a primary face (3) and a secondary face (4) are disposed, the secondary face (4) being in heat-exchanging contact with the primary face (3). The primary face (3) is provided with a primary flow path that is arranged between an inlet connection (5) and an outlet connection (6). A valve (14) is provided for controlling a fluid flow through the primary flow path. The aim of the invention is to design said heat exchanger in a compact manner. Said aim is achieved by embodying the valve (14) as a built-in valve while placing the valve (14) in the housing (2) by means of at least one part of a valve insert (15).