Back

Problems with getting headers in requests

  • 0
  • Functions
MH7
23 Oct, 2023, 16:53

HI,

I am using an appwrite function to bring me certain information based on its date, but the problem is when I try to group them with Nodejs it takes the date as it is stored.

I need to get the time difference to make an exact calculation I have appwrite version 1.3.4

TL;DR
There is a solution to this problem. You can try upgrading to version 1.4.6 and recreate the function using the new function syntax. Here are the steps: 1. Backup everything. 2. Upgrade to version 1.3.8 by running the following command: ```sh docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ appwrite/appwrite:1.3.8 ``` 3. Run the migrate command.
Drake
23 Oct, 2023, 16:55

not really sure what you mean...

Binyamin
23 Oct, 2023, 17:06

Are you trying to get the headers being sent to your 1.3.4 function?

MH7
23 Oct, 2023, 18:46

@Binyamin Yes

Binyamin
23 Oct, 2023, 18:49

Headers aren't passed to the function in version 1.3.4 you'll need to upgrade to version 1.4.6 and recrete the function using the new function syntax.

In your case I'll recommed do as follow

  1. Backup everything!
  2. Upgrade to version 1.3.8
TypeScript
docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="install" \
    appwrite/appwrite:1.3.8
  1. <a:ablobjoin:635256362850451476> Run migrate
  2. Upgrade to version 1.4.6
TypeScript
docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="upgrade" \
    appwrite/appwrite:1.4.6
  1. <a:ablobjoin:635256362850451476> Run migrate
  2. Redeploy the function.
Binyamin
23 Oct, 2023, 18:49

If you want to stay in that version, you can try this archived solution https://github.com/BoolCode/appwrite-funcover With Flatten Headers enabled

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more