Swashbuckle.aspnetcore: Request to routeprefix + index.html returns the petstore sample

Created on 12 Mar 2018  路  3Comments  路  Source: domaindrivendev/Swashbuckle.AspNetCore

Version 2.1.0 and 2.2.0

If user request routeprefix + index.html (for example /swagger/ui/index.html) the swagger UI default petstore sample is returned.

Looking at source it shows that the https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIBuilderExtensions.cs adds the fileserver which will return the embedded resources from the assembly.

Also there are some exclusion in the project file https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj, should it actually exclude that index.html?

Would be nice if these embedded resources are needed for some purpose then we should be able to hide these with some new settings other option is to create own route rules that do redirect if some user tries to get the index.html file.

Thanks for your great work, Antti :)

Most helpful comment

Up until a few moments ago, the excludes were in master only (i.e. not published). If you try the latest release (v2.3.0), this should be resolved.

All 3 comments

Can confirm this problem.

Up until a few moments ago, the excludes were in master only (i.e. not published). If you try the latest release (v2.3.0), this should be resolved.

Tested and works. Slap me if it is a "no, no" to comment on a closed ticket ;)
Thanks for the ultra fast fix!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

flipchart picture flipchart  路  4Comments

gabeluci picture gabeluci  路  3Comments

mrmartan picture mrmartan  路  3Comments

VisualBean picture VisualBean  路  4Comments

jderus picture jderus  路  4Comments