Skip to content

Commit

Permalink
Merge pull request #446 from miaowware/muf-fof2-bug
Browse files Browse the repository at this point in the history
Fix aiohttp/apache http2 bug in ?muf and ?fof2
  • Loading branch information
0x5c authored Jun 13, 2022
2 parents 68eaeff + e2d1d1f commit be083d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [Unreleased]
### Fixed
- Issue where `?muf` and `?fof2` would fail with an aiohttp error.


## [2.7.5] - 2022-06-08
Expand Down
4 changes: 2 additions & 2 deletions exts/propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, bot):
async def mufmap(self, ctx: commands.Context):
"""Shows a world map of the Maximum Usable Frequency (MUF)."""
async with ctx.typing():
async with self.session.get(self.muf_url) as r:
async with self.session.get(self.muf_url, headers={"Connection": "Upgrade", "Upgrade": "http/1.1"}) as r:
svg = await r.read()
out = BytesIO(cairosvg.svg2png(bytestring=svg))
file = discord.File(out, "muf_map.png")
Expand All @@ -47,7 +47,7 @@ async def mufmap(self, ctx: commands.Context):
async def fof2map(self, ctx: commands.Context):
"""Shows a world map of the Critical Frequency (foF2)."""
async with ctx.typing():
async with self.session.get(self.fof2_url) as r:
async with self.session.get(self.fof2_url, headers={"Connection": "Upgrade", "Upgrade": "http/1.1"}) as r:
svg = await r.read()
out = BytesIO(cairosvg.svg2png(bytestring=svg))
file = discord.File(out, "fof2_map.png")
Expand Down

0 comments on commit be083d2

Please sign in to comment.