Skip to content
Snippets Groups Projects
Unverified Commit df14af73 authored by LooSheng's avatar LooSheng Committed by GitHub
Browse files

fix: The profile is replaced when the request fails. (#246)

parent 2f740b57
No related branches found
No related tags found
No related merge requests found
use crate::utils::{config, dirs, help, tmpl};
use anyhow::{bail, Context, Result};
use reqwest::StatusCode;
use serde::{Deserialize, Serialize};
use serde_yaml::Mapping;
use std::fs;
......@@ -213,6 +214,12 @@ impl PrfItem {
builder = builder.user_agent(user_agent.unwrap_or(version));
let resp = builder.build()?.get(url).send().await?;
let status_code = resp.status();
if !StatusCode::is_success(&status_code) {
bail!("Error requesting remote profile.")
}
let header = resp.headers();
// parse the Subscription Userinfo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment