Skip to content

Instantly share code, notes, and snippets.

@chrisjpowers
Created December 15, 2010 16:22
Show Gist options
  • Save chrisjpowers/742190 to your computer and use it in GitHub Desktop.
Save chrisjpowers/742190 to your computer and use it in GitHub Desktop.
// Example taken from the CouchDB Pages app (though they used this inside a show page,
// while I'm using it on a list page -- could be part of the problem?).
//
// I get this same error any time that I return an object (rather than just a body string)
// inside a list function.
function(head, req) {
return {
code : 301,
headers : {
"Location" : "/my_path"
}
};
};
[error] [<0.17074.1>] Badarg error in HTTP request
[info] [<0.17074.1>] Stacktrace: [{erlang,list_to_binary,
[[{[{<<"code">>,301},
{<<"headers">>,
{[{<<"Location">>,<<"/my_path">>}]}}]}]]},
{couch_httpd_show,send_list_row,6},
{couch_httpd_view,'-make_view_fold_fun/7-fun-0-',12},
{couch_view,fold_fun,4},
{couch_btree,stream_kv_node2,8},
{couch_btree,stream_kp_node,7},
{couch_btree,fold,4},
{couch_view,fold,4}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment