Skip to content

Commit

Permalink
DB URL -> DB-ApiKey header instead of Authorization header, fix dupli…
Browse files Browse the repository at this point in the history
…cates in departure monitor (#406)
  • Loading branch information
felixguendling authored Nov 19, 2023
1 parent 0b0c90d commit 174192f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pkg
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
[nigiri]
[email protected]:motis-project/nigiri.git
branch=master
commit=6ab4efd0fdee59c208adfda3d8c74482e176d922
commit=236bea5afb3589a2b1ac2ed1969dd5c0ae3e8f98
[osmium]
[email protected]:motis-project/libosmium.git
branch=master
Expand Down
4 changes: 2 additions & 2 deletions .pkg.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4333485753525001497
16758824090160529896
cista a6218e9cd9da9e1c7a70c1188e2faf9e082b7f1c
zlib fe8e13ffca867612951bc6baf114e5ac8b00f305
boost be5235eb2258d2ec19e32546ab767a62311d9b46
Expand Down Expand Up @@ -28,7 +28,7 @@ net 44674d2f3917e20b7019a0f7254d332522c36fb7
protobuf e4d1f574ea9793308da9a942b4d5c1d4628aaed6
unordered_dense 4f380fb1d64f1843ca2c993ed39a8342a8747e5d
wyhash 1e012b57fc2227a9e583a57e2eacb3da99816d99
nigiri 6ab4efd0fdee59c208adfda3d8c74482e176d922
nigiri 236bea5afb3589a2b1ac2ed1969dd5c0ae3e8f98
lua 7bb93325b26f84c7e8b51fcbd857361ce7605a1d
luabind 9223568bbcf818ecfb1001d49f567627ee10852a
tbb 2067af88257710d07253761655a802732a32496e
Expand Down
2 changes: 2 additions & 0 deletions modules/nigiri/src/get_station.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "utl/concat.h"
#include "utl/enumerate.h"
#include "utl/erase_duplicates.h"

#include "nigiri/routing/journey.h"
#include "nigiri/rt/frun.h"
Expand Down Expand Up @@ -266,6 +267,7 @@ mm::msg_ptr get_station(tag_lookup const& tags, n::timetable const& tt,
locations.emplace_back(eq);
}
}
utl::erase_duplicates(locations);

auto const dir = req->direction() != railviz::Direction_EARLIER
? n::direction::kForward
Expand Down
4 changes: 3 additions & 1 deletion modules/nigiri/src/gtfsrt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ gtfsrt::gtfsrt(tag_lookup const& tags, std::string_view config) {
tag.view(), tags);
auto req = net::http::client::request{url.to_str()};
if (!auth.empty()) {
req.headers.emplace("Authorization", auth.to_str());
url.starts_with("https://gtfs-datenstroeme.tech.deutschebahn.com")
? req.headers.emplace("DB-Api-Key", auth.to_str())
: req.headers.emplace("Authorization", auth.to_str());
}
impl_ = std::make_unique<impl>(std::move(req), src);
}
Expand Down

0 comments on commit 174192f

Please sign in to comment.