couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <>
Subject Re: modifying headers inside lists after calling GetRow()
Date Mon, 30 Apr 2012 11:05:58 GMT
I think the intent of the patch is good. You can already abuse lists today
and I think you should be able to :)

Allowing to set headers based on rows is definitely helpful.

I haven't had time to look at the code yet, but I agree that we should
have something that implements this :)


On Apr 27, 2012, at 14:49 , Dave Cottlehuber wrote:

> Currently in lists, calls to getRow() flushes HTTP headers immediately.
> Caleb's put forward a patch for this [1] which enables you to defer
> sending headers until the first chunk of data is returned via send().
> People are using the ability to modify & set headers to do stuff like return
> HTTP error status after looking at row content, or redirecting elsewhere.
> But they want to do this after the list has inspected the content [2]. It's
> a popular request.
> However I'm not sure if this patch is abusing lists too far. Thoughts?
> The intent of lists/shows as I understand it was to be able to extend output
> past basic JSON - e.g. wrapping the view output as XML,SVG, or turning
> it directly
> into an HTML structure for low-end browsers and search engines.
> The patch above in principle would allow you to do any processing you like,
> including emulating a full reduce, with potential performance degradation, or
> any other data munging. But then you can already do that today, just you
> can't modify the headers based on row content.
> My thinking is that the functionality is useful, and that the concern around
> performance etc is already present. So if there's not a better solution, and it
> doesn't break on bigcouch integration, I would support it going in, and abusing
> lists a little more.
> [1]:
> [2]: and 514, 764, 1299
> A+
> Dave

View raw message