Skip to content

Commit 0a45328

Browse files
committed
Merge branch 'release/v0.12.12'
2 parents 0b8e2a4 + 4ab90f6 commit 0a45328

File tree

11 files changed

+50
-34
lines changed

11 files changed

+50
-34
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [[0.12.12]](https://github.com/thoth-pub/thoth/releases/tag/v0.12.12) - 2024-10-15
10+
### Fixed
11+
- [636](https://github.com/thoth-pub/thoth/issues/636) - OpenAPI documentation was displaying the public URL of the export API with an extra protocol
12+
913
## [[0.12.11]](https://github.com/thoth-pub/thoth/releases/tag/v0.12.11) - 2024-10-14
1014
### Changed
1115
- [324](https://github.com/thoth-pub/thoth/issues/324) - Make Locations editable, including the ability to change the Canonical Location for a Publication

Cargo.lock

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth"
3-
version = "0.12.11"
3+
version = "0.12.12"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -16,11 +16,11 @@ maintenance = { status = "actively-developed" }
1616
members = ["thoth-api", "thoth-api-server", "thoth-app", "thoth-app-server", "thoth-client", "thoth-errors", "thoth-export-server"]
1717

1818
[dependencies]
19-
thoth-api = { version = "=0.12.11", path = "thoth-api", features = ["backend"] }
20-
thoth-api-server = { version = "=0.12.11", path = "thoth-api-server" }
21-
thoth-app-server = { version = "=0.12.11", path = "thoth-app-server" }
22-
thoth-errors = { version = "=0.12.11", path = "thoth-errors" }
23-
thoth-export-server = { version = "=0.12.11", path = "thoth-export-server" }
19+
thoth-api = { version = "=0.12.12", path = "thoth-api", features = ["backend"] }
20+
thoth-api-server = { version = "=0.12.12", path = "thoth-api-server" }
21+
thoth-app-server = { version = "=0.12.12", path = "thoth-app-server" }
22+
thoth-errors = { version = "=0.12.12", path = "thoth-errors" }
23+
thoth-export-server = { version = "=0.12.12", path = "thoth-export-server" }
2424
clap = { version = "4.5.16", features = ["cargo", "env"] }
2525
dialoguer = { version = "0.11.0", features = ["password"] }
2626
dotenv = "0.15.0"

thoth-api-server/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api-server"
3-
version = "0.12.11"
3+
version = "0.12.12"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -9,8 +9,8 @@ repository = "https://github.com/thoth-pub/thoth"
99
readme = "README.md"
1010

1111
[dependencies]
12-
thoth-api = { version = "=0.12.11", path = "../thoth-api", features = ["backend"] }
13-
thoth-errors = { version = "=0.12.11", path = "../thoth-errors" }
12+
thoth-api = { version = "=0.12.12", path = "../thoth-api", features = ["backend"] }
13+
thoth-errors = { version = "=0.12.12", path = "../thoth-errors" }
1414
actix-web = "4.9"
1515
actix-cors = "0.7.0"
1616
actix-identity = "0.7.1"

thoth-api/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api"
3-
version = "0.12.11"
3+
version = "0.12.12"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -16,7 +16,7 @@ maintenance = { status = "actively-developed" }
1616
backend = ["diesel", "diesel-derive-enum", "diesel_migrations", "futures", "actix-web", "jsonwebtoken"]
1717

1818
[dependencies]
19-
thoth-errors = { version = "=0.12.11", path = "../thoth-errors" }
19+
thoth-errors = { version = "=0.12.12", path = "../thoth-errors" }
2020
actix-web = { version = "4.8", optional = true }
2121
argon2rs = "0.2.5"
2222
isbn2 = "0.4.0"

thoth-app-server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-app-server"
3-
version = "0.12.11"
3+
version = "0.12.12"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"

thoth-app/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-app"
3-
version = "0.12.11"
3+
version = "0.12.12"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -36,8 +36,8 @@ uuid = { version = "1.10.0", features = ["serde", "v4"] }
3636
# `getrandom` is a dependency of `uuid`, we need to explicitly import and include the `js` feature to enable wasm
3737
# https://docs.rs/getrandom/latest/getrandom/#webassembly-support
3838
getrandom = { version = "0.2", features = ["js"] }
39-
thoth-api = { version = "=0.12.11", path = "../thoth-api" }
40-
thoth-errors = { version = "=0.12.11", path = "../thoth-errors" }
39+
thoth-api = { version = "=0.12.12", path = "../thoth-api" }
40+
thoth-errors = { version = "=0.12.12", path = "../thoth-errors" }
4141

4242
[build-dependencies]
4343
dotenv = "0.15.0"

thoth-client/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-client"
3-
version = "0.12.11"
3+
version = "0.12.12"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -10,8 +10,8 @@ readme = "README.md"
1010
build = "build.rs"
1111

1212
[dependencies]
13-
thoth-api = {version = "=0.12.11", path = "../thoth-api" }
14-
thoth-errors = {version = "=0.12.11", path = "../thoth-errors" }
13+
thoth-api = {version = "=0.12.12", path = "../thoth-api" }
14+
thoth-errors = {version = "=0.12.12", path = "../thoth-errors" }
1515
graphql_client = "0.14.0"
1616
chrono = { version = "0.4.38", features = ["serde"] }
1717
reqwest = { version = "0.12", features = ["json"] }
@@ -22,4 +22,4 @@ serde_json = "1.0"
2222
uuid = { version = "1.10.0", features = ["serde"] }
2323

2424
[build-dependencies]
25-
thoth-api = { version = "=0.12.11", path = "../thoth-api", features = ["backend"] }
25+
thoth-api = { version = "=0.12.12", path = "../thoth-api", features = ["backend"] }

thoth-errors/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-errors"
3-
version = "0.12.11"
3+
version = "0.12.12"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"

thoth-export-server/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-export-server"
3-
version = "0.12.11"
3+
version = "0.12.12"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -10,9 +10,9 @@ readme = "README.md"
1010
build = "build.rs"
1111

1212
[dependencies]
13-
thoth-api = { version = "=0.12.11", path = "../thoth-api" }
14-
thoth-errors = { version = "=0.12.11", path = "../thoth-errors" }
15-
thoth-client = { version = "=0.12.11", path = "../thoth-client" }
13+
thoth-api = { version = "=0.12.12", path = "../thoth-api" }
14+
thoth-errors = { version = "=0.12.12", path = "../thoth-errors" }
15+
thoth-client = { version = "=0.12.12", path = "../thoth-client" }
1616
actix-web = "4.9"
1717
actix-cors = "0.7.0"
1818
cc_license = "0.1.0"

thoth-export-server/src/lib.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::time::Duration;
44
use actix_cors::Cors;
55
use actix_web::{middleware::Logger, web::Data, App, HttpServer};
66
use paperclip::actix::{web, web::HttpResponse, OpenApiExt};
7-
use paperclip::v2::models::{Contact, DefaultApiRaw, Info, License, Tag};
7+
use paperclip::v2::models::{Contact, DefaultApiRaw, Info, License, OperationProtocol, Tag};
88
use thoth_client::ThothClient;
99

1010
mod bibtex;
@@ -56,8 +56,20 @@ pub async fn start_server(
5656
log::info!("Setting Thoth GraphQL endpoint to {}", gql_endpoint);
5757

5858
HttpServer::new(move || {
59+
// extract hostname and protocol from public URL
60+
let (protocol, host) = public_url
61+
.strip_prefix("https://")
62+
.map(|stripped| (OperationProtocol::Https, stripped))
63+
.or_else(|| {
64+
public_url
65+
.strip_prefix("http://")
66+
.map(|stripped| (OperationProtocol::Http, stripped))
67+
})
68+
.unwrap_or((OperationProtocol::Http, public_url.as_str()));
69+
5970
let spec = DefaultApiRaw {
60-
host: Some(public_url.clone()),
71+
host: Some(host.to_string()),
72+
schemes: [protocol].into_iter().collect(),
6173
tags: vec![
6274
Tag {
6375
name: "Formats".to_string(),

0 commit comments

Comments
 (0)