Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-13014

FIWARE.Request.Lab.Spain.FIWARE: localhost - Access-Control-Allow-Headers.

    Details

    • Type: extRequest
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Fix Version/s: 2021
    • Component/s: FIWARE-LAB-HELP
    • Labels:
      None

      Description

      HI, i'm trying to use orion on a localhost. I installed is as follows:
      mongo:
      image: mongo:3.4
      command: --nojournal
      orion:
      image: fiware/orion
      links:

      • mongo
        ports:
      • "1026:1026"
        command: -dbhost mongo -corsOrigin __ALL

      and i used the command: docker-compose up
      this solved my problems with the get method, but other operations like post
      are returning me control-access-allow-header.
      How do i solve this problem?

      I'm using: javascript, jQuery.

      orion is installed: localhost:1026
      my aplication: localhost:63342

      Function post->

      function postEntities() {
      var settings = {
      "async": true,
      "url": "http://localhost:1026/v2/entities/",
      "method": "POST",
      "headers":

      { "content-type": "application/json", "cache-control": "no-cache" }

      ,
      "data": "{\"id\": \"2\", \"type\": \"teste\", \"nome\":
      {\"value\": \"Weslan\", \"type\": \"text\"}}"
      }

      $.ajax(settings).done(function (response)

      { console.log(response); }

      );
      }

      __________________________________________________________________________________________

      You can get more information about our cookies and privacy policies on the following links:

      Fiware-lab-help mailing list
      Fiware-lab-help@lists.fiware.org
      https://lists.fiware.org/listinfo/fiware-lab-help

      [Created via e-mail received from: Weslan Rezende <weslan.rezende@gmail.com>]

        Activity

        Hide
        jicg José Ignacio Carretero Guarde added a comment - - edited

        Dear user,

        I've tested your example, and I think the error you can be observing is: "Request header field cache-control is not allowed by Access-Control-Allow-Headers in preflight response." — This means that you should remove your "cache-control": "no-cache" and the request can be made. This is related to the javascript and the navigator, not to Orion.

        Please, consider using a volume for data in your MongoDB. Docker filesystem doesn't behave well with databases.

        Regards,
        José Ignacio.

        Show
        jicg José Ignacio Carretero Guarde added a comment - - edited Dear user, I've tested your example, and I think the error you can be observing is: "Request header field cache-control is not allowed by Access-Control-Allow-Headers in preflight response." — This means that you should remove your "cache-control": "no-cache" and the request can be made. This is related to the javascript and the navigator, not to Orion. Please, consider using a volume for data in your MongoDB. Docker filesystem doesn't behave well with databases. Regards, José Ignacio.
        Hide
        fw.ext.user FW External User added a comment -

        Comment by weslan.rezende@gmail.com :

        thanks, fix the function and the post method is working.
        But i do not understand what imean by:
        "Please, consider using a volume for data in your MongoDB. Docker
        filesystem doesn't behave well with databases."

        .

        2017-12-05 11:51 GMT-03:00 Help-Desk <jira-help-desk@jira.fiware.org>:

        >
        >

        Show
        fw.ext.user FW External User added a comment - Comment by weslan.rezende@gmail.com : thanks, fix the function and the post method is working. But i do not understand what imean by: "Please, consider using a volume for data in your MongoDB. Docker filesystem doesn't behave well with databases." . 2017-12-05 11:51 GMT-03:00 Help-Desk <jira-help-desk@jira.fiware.org>: > >
        Hide
        fw.ext.user FW External User added a comment -

        Comment by jira-help-desk@jira.fiware.org :
        Renamed attached file: '[FIWARE-JIRA] (HELP-13014) FIWARE.Request.Lab.FIWARE: localhost - Access-Control-Allow-Headers.' to '[FIWARE-JIRA] (HELP-13014) FIWARE.Request.Lab.FIWARE_ localhost - Access-Control-Allow-Headers.' because it contained invalid character(s).

        Show
        fw.ext.user FW External User added a comment - Comment by jira-help-desk@jira.fiware.org : Renamed attached file: ' [FIWARE-JIRA] ( HELP-13014 ) FIWARE.Request.Lab.FIWARE: localhost - Access-Control-Allow-Headers.' to ' [FIWARE-JIRA] ( HELP-13014 ) FIWARE.Request.Lab.FIWARE_ localhost - Access-Control-Allow-Headers.' because it contained invalid character(s).

          People

          • Assignee:
            jicg José Ignacio Carretero Guarde
            Reporter:
            fw.ext.user FW External User
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: