Skip to content

geneQuery POST uses invalid Content-Type form-urlencoded #767

@jvwong

Description

@jvwong

Environment info

  • Browser version (client) : n/a
  • Node.js version (server) : 8

Current (buggy) behaviour

In several instances, the search infobox code calls geneQuery using POST with Content-Type (application/x-www-form-urlencoded).

/src/client/services/server-api/index.js

  geneQuery(query){
    query.genes=_.concat(['padding'],query.genes.split(' '));
    return fetch('/api/validation', {
      method:'POST', 
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      body:qs.stringify(query)
    }).then(res => res.json()).then(ids=> _.assign(ids,{unrecognized:_.tail(ids.unrecognized)}));//remove padding
  },

Why this still works is not completely clear to me but it is accepted by the service if I add a gene value padding:

image

Desired behaviour

POST data with Content-Type application/json

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions