Stress because of the boss

Hello ladies.

I'm stressed because of work. I have a very demanding job with a lot of responsibility; i signed my contract for 1 year, with possibility to prolong it after it ends. 6 months after the beginning of the job we got pregnant (planned pregnancy). I told my bosses (I have two of them). Boss #1 was ok with that and he just wanted to know my pdd and the period of maternity leave. In my country maternity leave is 6 months. Boss #2 was shocked and said that after i give birth she wants to find a replacement for me (and she implied she wanted a permanent replacement), since 6 months is too long for her (she is a foreigner, in her country pregnant women are usually pressured to leave work altogether). She also added that i should have told about planning pregancy in the future during my job interview (in my country it is illegal to ask such questions at job interviews and women are not obliged to share such information- i don't know how it is in her country).

So meanwhile i found myself in the reality where i will probably be fired before i give birth (which is possible if they chose not to prolong the contract, which is basically legal in this case).

That adds stess to my already very stressful job and i'm worried that i'm too stressed and it can harm the baby. I also have no idea how to keep my relations with her, since that conversation left a bad aftertaste for me.