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

Vaultwarden "/alive" endpoint #4423

Closed
2 tasks done
LightD31 opened this issue Jan 25, 2024 · 2 comments · Fixed by #4425
Closed
2 tasks done

Vaultwarden "/alive" endpoint #4423

LightD31 opened this issue Jan 25, 2024 · 2 comments · Fixed by #4425
Labels
area:monitor Everything related to monitors bug Something isn't working

Comments

@LightD31
Copy link

LightD31 commented Jan 25, 2024

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

Description

Vaultwarden has a "/alive" endpoint that returns a string containing a single timestamp e.g. "2024-01-25T13:57:13.532029Z"
Using the JSON query, I can't parse this JSON, but it works just fine in https://try.jsonata.org/

👟 Reproduction steps

Use the HTTP - JSON query probe
Use a website that returns a single string as JSON
Try to parse the JSON (For example ($toMillis($now())-$toMillis($))<10000

👀 Expected behavior

The JSON parses just fine

😓 Actual Behavior

The JSON isn't parsed

🐻 Uptime-Kuma Version

1.23.11

💻 Operating System and Arch

Debian 12 (Proxmox LXC)

🌐 Browser

Firefox 122

🐋 Docker Version

No response

🟩 NodeJS Version

No response

📝 Relevant log output

No response

@LightD31 LightD31 added the bug Something isn't working label Jan 25, 2024
@chakflying
Copy link
Collaborator

chakflying commented Jan 25, 2024

} else if (this.type === "json-query") {
let data = res.data;
// convert data to object
if (typeof data === "string") {
data = JSON.parse(data);
}

I think this was added because when we receive a string, it's likely that we have received a serialized JSON that needs parsing. We didn't expect it to be an already parsed JSON, which is "just a string".

I wonder if we can check the response content-type to prevent this.

But this would be a somewhat breaking change, so don't expect it to be fixed soon.

@louislam
Copy link
Owner

Found a related discussion:
https://vaultwarden.discourse.group/t/return-alive-response-in-json-format/2905

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:monitor Everything related to monitors bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants