Files
comun/docs/http_romfast_user_agent.md
2026-09-29 16:36:56 +03:00

1.3 KiB

Cereri HTTP catre romfast.ro: User-Agent obligatoriu

romfast.ro / www.romfast.ro (hosting romarg, 89.42.218.17): firewall-ul taie cererile cu User-Agent-ul implicit WinHTTP (Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)) si apoi blocheaza IP-ul clientului cateva minute (ERR_CONNECTION_RESET pe 80/443, si din browser). roa.romfast.ro e alt server (188.26.14.103) - neafectat.

  • Afectate: WinHttp.WinHttpRequest.5.1 si MSXML2.ServerXMLHTTP (foloseste WinHTTP dedesubt). Neafectate: MSXML2.XMLHTTP (WinInet) si browserul.
  • Regula: orice cerere catre romfast.ro primeste, dupa .Open(...): loHTTP.SetRequestHeader('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)')
  • Simptom in VFP: "OLE IDispatch exception code 0 from msxml6.dll: The download of the specified resource has failed." - vine din fallback-ul MSXML, dupa ce WinHTTP a blocat deja IP-ul.
  • Testare: niciodata cu User-Agent-ul implicit WinHTTP (blocheaza IP-ul biroului). Inainte si dupa: (Invoke-WebRequest https://romfast.ro/ -UseBasicParsing -TimeoutSec 8).StatusCode -> 200.
  • Corectate deja (COMUN\programe): anaf_efactura.prg (newToken, refreshToken), xmlefactura-preview.prg (editare in browser), oproceduri_comune.prg (HTTPDownloadFile), actualizare_aplicatie.prg.