Spaces:
Runtime error
Runtime error
neon_arch
commited on
Commit
β’
7d42c84
1
Parent(s):
72da323
ποΈ fix(engine): fix the pagination code for `startpage` engine (#468)
Browse files- src/engines/startpage.rs +4 -11
src/engines/startpage.rs
CHANGED
@@ -50,17 +50,10 @@ impl SearchEngine for Startpage {
|
|
50 |
) -> Result<HashMap<String, SearchResult>, EngineError> {
|
51 |
// Page number can be missing or empty string and so appropriate handling is required
|
52 |
// so that upstream server recieves valid page number.
|
53 |
-
let url: String =
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
_ => {
|
58 |
-
format!(
|
59 |
-
"https://startpage.com/do/dsearch?q={query}&num=10&start={}",
|
60 |
-
page * 10,
|
61 |
-
)
|
62 |
-
}
|
63 |
-
};
|
64 |
|
65 |
// initializing HeaderMap and adding appropriate headers.
|
66 |
let header_map = HeaderMap::try_from(&HashMap::from([
|
|
|
50 |
) -> Result<HashMap<String, SearchResult>, EngineError> {
|
51 |
// Page number can be missing or empty string and so appropriate handling is required
|
52 |
// so that upstream server recieves valid page number.
|
53 |
+
let url: String = format!(
|
54 |
+
"https://startpage.com/do/dsearch?q={query}&num=10&start={}",
|
55 |
+
page * 10,
|
56 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
// initializing HeaderMap and adding appropriate headers.
|
59 |
let header_map = HeaderMap::try_from(&HashMap::from([
|