Menu

#277 [textops] "append_hf" with "remove_hf" don't work

ver devel
closed-invalid
modules (357)
5
2007-09-04
2007-09-02
No

OpenSer 1.2.2.

This bug/wish only would make sense if report #1786664 works. Anyway I tell it:

If I had a header and remove it (during the same process) finally that header is just added:

append_hf("New-Header: Yes\r\n");
remove_hf("New-Header");

After the message is sent it has that header, but it is expected not to contain it.

I know that the header operations are made after the routing has finished, but somewhere the logic to apply is stored, and this logic could be improved in order not to add a header if it has been removed during the same route process.

If this bug wouuld fix/improved and #1786664 too, then I could do things like:

append_hf("New-Branch: Yes\r\n");
append_branch();
remove_hf("New-Branch");

So just the new branch would have the header, but not the original branch.

Discussion

  • Daniel-Constantin Mierla

    Logged In: YES
    user_id=1246013
    Originator: NO

    This does not work -- it is a known "feature" of openser. remove_hf() works on original message, while append_hf() adds a diff (lump) to a list, which is applied to original message just before forwarding the request. So, on other words, after append_hf() you won't see the new header in the message with is_present_hf().

    The solution is to set an avp or flags, use them to test, and add the header only when you are sure it should be added.

     
  • Daniel-Constantin Mierla

    • milestone: --> ver devel
    • assigned_to: nobody --> miconda
    • status: open --> closed-invalid
     

Log in to post a comment.