/*
* Hello Brandley, tonight I've tried to figure out how to do proper
* JSON POSTs using "Content-type: application/json" and serialized JSON
* data in the content portion (body) of my HTTP requests. This is
* specified in the Twitter API for status updates and Identica JSON
* webservices (found via Mark Pilgrim).
* After some tests, I had to recognize that jQuery does not support JSON
* encoding in the core distribution and aside of $.getJSON(), there
* is no $.postJSON().
* Below is an proposed update. As it relies on your json plugin, I'd ask
* you to add it to your code base so that other jQuery users can benefit
* of it.
*/
$.postJSON = function(url, data, callback) {
return jQuery.ajax({
'type': 'POST',
'url': url,
'contentType': 'application/json',
'data': $.toJSON(data),
'dataType': 'json',
'success': callback
});
};
Posts Tagged ‘patch’
jQuery.postJSON()
Published October 18th, 2009.Squid LDAP Authentication
Published May 9th, 2007, updated February 29th, 2008.This is a proposed patch for squid_auth_ldap, the authentication helper of the Squid Cache. It increases the maximum filter length to 32k and thus, enables long search filters. Wow:-)
# patch for squid-2.6.STABLE11, enables long search filters # author: Benjamin Schweizer# diff -r squid-2.6.STABLE11/helpers/basic_auth/LDAP/squid_ldap_auth.c \ squid-2.6.STABLE11-sickos/helpers/basic_auth/LDAP/squid_ldap_auth.c 32a33,34 > * 2007-05-09: Benjamin Schweizer> * - Increased buffer size to support long search filters. 343c345 < char buf[256]; --- > char buf[32768]; 566c568 < while (fgets(buf, 256, stdin) != NULL) { --- > while (fgets(buf, sizeof(buf), stdin) != NULL) { 653c655 < char filter[256]; --- > char filter[32768];
As of Aug 27, 2007, this patch is included in the cvs tree.
GnuDIP/MiniDIP Password Encryption
Published January 18th, 2007, updated February 29th, 2008.This is a patch for GnuDIP’s minidip server. It switches the password storage format from plain text to md5 hashes, so you can copy passwords from GnuDIP to MiniDIP and vice versa. Furthermore, this allows you to use arbitrary characters in your passwords without breaking the format of the config files. Use GnuDIP’s encpass utility to encrypt passwords.
# patch for gnudip-2.3.5, changes auth database to md5
# author: Benjamin Schweizer
# diff -r gnudip-2.3.5/gnudip/sbin/minidip.pl \
gnudip-2.3.5bs/gnudip/sbin/minidip.pl
185c185,187
< $checkpass = md5_hex(md5_hex($checkpass) . '.' . $salt)
---
> # 2007-01-18, schweizer: storing passwords md5 hashed (as in gnudip/mysql)
> #$checkpass = md5_hex(md5_hex($checkpass) . '.' . $salt)
> $checkpass = md5_hex($checkpass . '.' . $salt)
