Skip to content

Commit

Permalink
Fix Issue #4
Browse files Browse the repository at this point in the history
Set a user-agent so we don't get blocked by lemmy.ml.
  • Loading branch information
CMahaff authored Jul 8, 2023
1 parent f762a98 commit 38efc7d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "lasim"
authors = ["Connor Mahaffey"]
version = "0.1.0"
version = "0.1.1"
edition = "2021"
license = "MIT"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
## Version Support
| LASIM Version | LASIM Profile Version | Supported Lemmy BE API Version |
| ------------- | --------------------- | ------------------------------ |
| 0.1.0 | 1 | 0.18.1-rc.9+ |
| 0.1.\* | 1 | 0.18.1 (rc.9+) |
9 changes: 7 additions & 2 deletions src/lemmy/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use lemmy_api_common::site;
use lemmy_api_common::community;
use lemmy_api_common::lemmy_db_schema::newtypes;
use reqwest::Client;
use reqwest::ClientBuilder;
use reqwest::Response;
use reqwest::Error;
use url::Url;
Expand All @@ -16,8 +17,12 @@ pub struct API {

impl API {
pub fn new(instance: Url) -> API {
API {
client: Client::new(),
let mut client_builder = ClientBuilder::new();
client_builder = client_builder.user_agent("LASIM - https://github.com/CMahaff/lasim");
let new_client = client_builder.build().unwrap();

return API {
client: new_client,
instance,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/app.slint
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export component App inherits Window {
Text {
font-size: 20px;
font-weight: 900;
text: "LASIM 0.1.0";
text: "LASIM 0.1.1";
}
Text {
text: "Lemmy BE API Version 0.18.1-rc.9";
Expand Down

0 comments on commit 38efc7d

Please sign in to comment.