Skip to content

Commit

Permalink
Explicit HttpMethod bindings to PwaController (#62)
Browse files Browse the repository at this point in the history
Added explicit HttpMethod bindings to add compatibility with Swashbuckle (Swagger) to prevent following issue TrilonIO/aspnetcore-angular-universal#656
  • Loading branch information
antoninkriz authored and madskristensen committed Aug 12, 2019
1 parent 4110646 commit 69f4125
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/PwaController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public PwaController(PwaOptions options)
/// Serves a service worker based on the provided settings.
/// </summary>
[Route(Constants.ServiceworkerRoute)]
[HttpGet]
public async Task<IActionResult> ServiceWorkerAsync()
{
Response.ContentType = "application/javascript; charset=utf-8";
Expand All @@ -52,6 +53,7 @@ public async Task<IActionResult> ServiceWorkerAsync()
/// Serves the offline.html file
/// </summary>
[Route(Constants.Offlineroute)]
[HttpGet]
public async Task<IActionResult> OfflineAsync()
{
Response.ContentType = "text/html";
Expand All @@ -66,9 +68,10 @@ public async Task<IActionResult> OfflineAsync()
}

/// <summary>
/// Serves the offline.html file
/// Serves the manifest.json file
/// </summary>
[Route(Constants.WebManifestRoute)]
[HttpGet]
public IActionResult WebManifest([FromServices] WebManifest wm)
{
if (wm == null)
Expand Down

1 comment on commit 69f4125

@EmaGht
Copy link

@EmaGht EmaGht commented on 69f4125 Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will this fix be online? I'm still having this problem on version 1.0.59 of NuGet package

Please sign in to comment.