There's already some code that does essentially this in proxy_process_register_response.  We should change that function to use this utility as well.

Also, it dups the string using pj_strdup_with_null rather than manually.

    pj_str_t hvalue;
    pj_strdup_with_null(pool, &hvalue, &hdr->hvalue);