Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please remove Byte Order Mark returned from drive's export in 'text/plain' format #2404

Open
aryzing opened this issue Oct 13, 2020 · 1 comment
Assignees
Labels
external This issue is blocked on a bug with the actual product. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@aryzing
Copy link

aryzing commented Oct 13, 2020

  1. Is this a client library issue or a product issue?

Client library issue

  1. Did someone already solve this?

no

  1. Do you have a support contract?

no

Environment details

  • OS: Linux 5.4 Ubuntu 18.04.5 LTS (Bionic Beaver)
  • Node.js version: 14.4.0
  • npm version: 6.14.5
  • googleapis version: 61.0.0

Steps to reproduce

  1. Make a create request, using for the body a string that does not begin with a Byte Order Mark and a mimeType of 'text/plain', such as
const requestBody = {
  name,
  parents: [folderId],
  mimeType: 'application/vnd.google-apps.document',
};
const media = {
  mimeType: 'text/plain',
  body: 'foo', // <--- This string doesn't have a BOM.
};
const data = await drive.files.create({
  requestBody,
  media,
  fields: 'id',
});
  1. Make an export request of the previously created file with the mimeType set to 'text/plain', such as
const { data } = await drive.files.export({
  fileId: id,
  mimeType: 'text/plain',
});
  1. The value data.content will contain a string that starts with a Byte Order Mark, "\uFFEFfoo", which was not in the original string.

Being the BOM an invisible character, it is increadibly hard to spot. This makes tests and application code harder to develop.

@sofisl sofisl added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 13, 2020
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Jan 11, 2021
@sofisl sofisl self-assigned this Apr 8, 2021
@sofisl sofisl added the external This issue is blocked on a bug with the actual product. label Apr 8, 2021
@sofisl
Copy link
Contributor

sofisl commented Apr 8, 2021

Hi @aryzing, I've been able to confirm this is occurring. Thanks for submitting.

This client library is auto-generated, and this issue is actually an underlying issue with the API itself, not with this library. Therefore, I've gone ahead and created a bug with the API that you can follow along here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external This issue is blocked on a bug with the actual product. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants