Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SudoDios committed Sep 11, 2024
1 parent ab0f890 commit 58fa47f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ Compatible with all librespeed clients :

### Build with docker

0. Install docker and docker-compose.
1. Install docker and docker-compose.

1. Clone the repository:
2. Clone the repository:

```sh
$ git clone https://github.com/librespeed/speedtest-rust.git
$ cd speedtest-rust
```

2. Copy the default config and assets:
3. Copy the default config and assets:

```sh
$ cp docker-compose.override.sample.yml docker-compose.override.yml
Expand All @@ -67,7 +67,7 @@ Compatible with all librespeed clients :
$ sudo cp -r assets /var/lib/librespeed/assets
```

3. Edit the config files:
4. Edit the config files:

```sh
$ sudo chmod o-rwx /etc/librespeed.toml docker-compose.override.yml # Hide secrets
Expand All @@ -77,14 +77,14 @@ Compatible with all librespeed clients :
$ sudo $EDITOR /var/lib/librespeed/assets/index.html # To change html styles, etc
```

4. Start the container:
5. Start the container:

```sh
$ docker-compose up -d
$ docker-compose logs -f # To check status
$ docker compose up -d
$ docker compose logs -f # To check status
```

5. Navigate to http://localhost:8080/
6. Navigate to http://localhost:8080/

### Compile from source

Expand Down
7 changes: 1 addition & 6 deletions src/http/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,7 @@ fn check_has_body(headers : &HashMap<String,String>) -> (Option<BodyType>,Option
};
//check fixed body
if let Some(content_len) = headers.get("Content-Length") {
let content_len = match content_len.parse::<u64>() {
Ok(v) => { v }
Err(_) => {
0
}
};
let content_len = content_len.parse::<u64>().unwrap_or(0);
if content_len > 0 {
let body_type = if let Some(content_type_form) = content_type_form {
content_type_form
Expand Down

0 comments on commit 58fa47f

Please sign in to comment.