18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

sahi proxy send empty Cookie

edited November -1 in Sahi - Open Source
hi,

when i try to use sahi with my application i see it's add a special cookie 'sahisid'.
it's the only one cookie my browser have, but on server side in header, Cookie is empty.
my server use libhttp that do not accept empty value, so when i try to connect via
sahi proxy the server response 400 Bad Request.
Is it possible to sahi proxy to remove the Cookie from header if it's empty?
Without this feature i will never be able to use sahi on my server.

I use Firefox : 3.6.15
and sahi Version : V3.5
Build : 2011-02-13

Comments

  • to correct this problème i have add this code after line 300 in file request/HttpRequest.java

    if (cookieStr.endsWith(";")) {
    cookieStr = cookieStr.substring(0, cookieStr.length() - 1);
    }

    after recompile. i can have access to my server :)
  • narayannarayan Administrators
    Hi francois.lecroart,

    Thanks a lot for the fix. We should not have been sending that cookie to the server. We will check why it was being sent.

    Thanks again,
    Narayan
  • hey

    I juste came back from hollidays.
    In my last most i make a mistake the code i have give is not the solution .... sorry for that, i was to tired.

    to fix this issue juste add thos line in request/HttpRequest.java at line 381 :

    if (stripped.trim().length() > 0) {
    setHeader("Cookie", stripped.trim());
    }

    i hop this will help you
    and thank for your quick response :)
Sign In or Register to comment.