Closed livarcocc closed 6 years ago
@mkArtakMSFT @ryanbrandenburg PTAL
@javiercn, can you please look into this?
I do believe that this is controlled simply by the --no-https option and that Auth doesn't play a role in it at the templates level. I do believe VS has some logic around auth and HTTPS, but that's it. I don't think it matters that much either as we changed the redirection middleware after preview2 to NOOP if it can't figure out an HTTPS port to redirect to.
I would just close this as by design. See https://github.com/aspnet/templating/commit/cb7942abe41eebbbe574c515b171e6bb9f48fbdd for the original change
Hi @WingedDante.
Can you please share the link of the docs you've read about the auth configuration using --au
option?
This is more of a docs issue, which would be great to fix.
Sure, the documentation I was looking at for the dotnet new
command was here. I had just assumed it was from the -au
flag because there wasn't a --no-https
listed as either one of the base dotnet new
options, nor one of the template specific ones, and I saw parts of the changes @javiercn mentioned. I did try it with the --no-https
option and did get the expected output. Adding in something about the --no-https
option would definitely be helpful. Thanks everyone.
@javiercn, can you please take care of getting the docs updated to mention about no-https
option. Thanks!
@Rick-Anderson Can you take care of this?
Closing this in favor of the referenced docs bug: https://github.com/aspnet/Docs/issues/6923
From @WingedDante on May 31, 2018 19:55
Steps to reproduce
Ensure you're on 2.1.300
Run
dotnet new webapi -n="example"
Examine Startup.cs in the example project folder.
As far as I'm aware and can find in the docs, and looking through the template code, the UseHsts and UseHttpsRedirection are only supposed to be output if the -au(--auth) flag is set, and it's supposed to default to none if one isn't supplied. Unless this functionality has changed.
Expected behavior
Creates a new webapi project from template with no SSL created in Startup.cs.
Actual behavior
Creates a new webapi project from template with SSL created in Startup.cs, ignoring the default 'None' value for the auth flag.
These lines are added
I compared with the older sdk using a global json setting it to 2.0.3, and the webapi project was created correctly.
Environment data
dotnet --info
output:Copied from original issue: dotnet/cli#9387