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

Fix null id in arguments #330

Merged
merged 2 commits into from
Oct 30, 2018
Merged

Fix null id in arguments #330

merged 2 commits into from
Oct 30, 2018

Conversation

Aschen
Copy link
Contributor

@Aschen Aschen commented Oct 29, 2018

What does this PR do?

This PR prevent to add null or undefined arguments to the query args in http protocol.

Fix #324

How should this be manually tested?

Run this snippet at the root of sdk-javascript folder, the document id should not be the string 'null':

const Kuzzle = require('./index').Kuzzle;

const kuzzle = new Kuzzle('http', { host: 'localhost', port: 7512 });

(async () => {
  try {
    await kuzzle.connect()
    await kuzzle.index.create('index');
    await kuzzle.collection.create('index', 'collection');

    const doc = await kuzzle.document.create(
      'index',
      'collection',
      null,
      { hello: 'world' },
      { refresh: 'wait_for' }
    );
    console.log(doc);

    const document = await kuzzle.document.get('index', 'collection', doc._id);

    console.log(document);
  } catch (error) {
    console.log(error);
  }
})()

@Aschen Aschen changed the base branch from master to 6-dev October 29, 2018 10:17
@Aschen Aschen self-assigned this Oct 29, 2018
@codecov-io
Copy link

codecov-io commented Oct 29, 2018

Codecov Report

Merging #330 into 6-dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           6-dev    #330      +/-   ##
========================================
+ Coverage   97.5%   97.5%   +<.01%     
========================================
  Files         28      28              
  Lines       1404    1405       +1     
========================================
+ Hits        1369    1370       +1     
  Misses        35      35
Impacted Files Coverage Δ
src/networkWrapper/protocols/http.js 88.23% <100%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 391bc8c...3406058. Read the comment docs.

@etrousset etrousset merged commit 1fbe6ef into 6-dev Oct 30, 2018
@etrousset etrousset deleted the fix-null-id-in-arguments branch October 30, 2018 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants