Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Fix stringified buffer who not allow base64 change #383

Closed
wants to merge 1 commit into from

Conversation

feraudet
Copy link

Fix #359

@peoro
Copy link

peoro commented Apr 11, 2018

This PR is badly needed, binary data cannot be sent to the server otherwise.

In case anybody cares, I found a hacky way to achieve the effect of this PR:

// HACK: ldapjs calls `toString()` on a buffer when it shouldn't...
// See https://github.com/joyent/node-ldapjs/pull/383
picture.toString = function() { return this; };

const entry = {
	operation: 'replace',
	modification: {
		'jpegPhoto': picture
	}
};

return client.modify( `cn=${user},ou=People,dc=peori,dc=space`, entry );

@HappyHappy1996
Copy link

@peoro thanks, it saved me lots of time, a smart and tricky solution

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add some unit tests for this?

@jsumners jsumners added the closed-for-v2 Issues that were closed at the release of v2.0.0 but may still need to be addressed. label May 31, 2020
@jsumners jsumners closed this May 31, 2020
@jsumners
Copy link
Member

⚠️ This issue has been locked due to age. If you have encountered a recent
problem that seems to be covered by this issue, please open a new issue.

Please include a minimal reproducible example
when opening a new issue.

@ldapjs ldapjs locked as resolved and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closed-for-v2 Issues that were closed at the release of v2.0.0 but may still need to be addressed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is possible to write the binary field jpegPhoto, adding a ldap entry?
4 participants