-#ifdef GAGA
- if (pc->first_response) // Check if this is a redirect
- {
- int len;
- if ((len = package_check(htbuf->buf)))
- {
- struct http_response *res = http_parse_response_buf(hc, htbuf->buf, len);
- if (res)
- {
- const char *location = http_lookup_header(
- res->header, "Location");
- if (location)
- {
- // We found a location header. Rewrite it.
- struct http_buf *buf;
- h->value = sub_hostname(hc, location);
- buf = http_serialize_response(hc, res);
- yaz_log(YLOG_LOG, "Proxy rewrite");
- http_buf_enqueue(&hc->oqueue, buf);
- htbuf->offset = len;
- break;
- }
- }
- }
- pc->first_response = 0;
- }
-#endif