Skip to content

Block HTTP option #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions Services/Startup.dbl
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,6 @@ namespace Services
;This requires a reference to the NuGet package Swashbuckle.AspNetCore.Newtonsoft in the Services project
services.AddSwaggerGenNewtonsoftSupport()

;;-------------------------------------------------------
;;Enable HTTP redirection to HTTPS

lambda httpsConfig(options)
begin
options.RedirectStatusCode = StatusCodes.Status307TemporaryRedirect
options.HttpsPort = 8086
end

services.AddHttpsRedirection(httpsConfig)

;; -------------------------------------------------------------------------------
;;Add SignalR support
services.AddSignalR().AddNewtonsoftJsonProtocol()
Expand Down Expand Up @@ -374,11 +363,6 @@ namespace Services
;app.UseHsts()
;end

;;-------------------------------------------------------
;;Enable HTTP redirection to HTTPS

app.UseHttpsRedirection()


;;-------------------------------------------------------
;;Enable MVC
Expand Down
6 changes: 6 additions & 0 deletions Templates/ODataStartup.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ namespace <NAMESPACE>

;;Add OData query fields to swagger documentation
c.OperationFilter<ODataParametersSwaggerDefinition>()
<IF DEFINED_ENABLE_XMLDOC>

data xmlDocFolder = findRelativeFolderForAssembly("XmlDoc")

Expand All @@ -320,6 +321,7 @@ namespace <NAMESPACE>
c.IncludeXmlComments(filePath, true)
end
end
</IF DEFINED_ENABLE_XMLDOC>
<IF DEFINED_ENABLE_AUTHENTICATION>
<IF DEFINED_ENABLE_CUSTOM_AUTHENTICATION>

Expand Down Expand Up @@ -435,6 +437,7 @@ namespace <NAMESPACE>
</IF DEFINED_ENABLE_CUSTOM_AUTHENTICATION>
</IF DEFINED_ENABLE_AUTHENTICATION>

<IF DEFINED_ENABLE_BLOCK_HTTP>
;;-------------------------------------------------------
;;Enable HTTP redirection to HTTPS

Expand All @@ -446,6 +449,7 @@ namespace <NAMESPACE>

services.AddHttpsRedirection(httpsConfig)

</IF DEFINED_ENABLE_BLOCK_HTTP>
<IF DEFINED_ENABLE_IIS_SUPPORT>
;;-------------------------------------------------------
;;Enable support for hosting in IIS
Expand Down Expand Up @@ -540,11 +544,13 @@ namespace <NAMESPACE>
;app.UseHsts()
;end

<IF DEFINED_ENABLE_BLOCK_HTTP>
;;-------------------------------------------------------
;;Enable HTTP redirection to HTTPS

app.UseHttpsRedirection()

</IF DEFINED_ENABLE_BLOCK_HTTP>
<IF DEFINED_ENABLE_AUTHENTICATION>
;;-------------------------------------------------------
;;Enable the authentication middleware
Expand Down
4 changes: 3 additions & 1 deletion regen.bat
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ rem set ENABLE_XFSERVERPLUS_MIGRATION=YES
rem set ENABLE_XFSERVERPLUS_MODEL_GENERATION=YES
rem set ENABLE_BRIDGE_OPTIONAL_PARAMETERS=YES
set ENABLE_NEWTONSOFT=-define ENABLE_NEWTONSOFT
rem set ENABLE_BLOCK_HTTP=-define ENABLE_BLOCK_HTTP
set ENABLE_XMLDOC=-define ENABLE_XMLDOC

if not "NONE%ENABLE_SELECT%%ENABLE_FILTER%%ENABLE_ORDERBY%%ENABLE_TOP%%ENABLE_SKIP%%ENABLE_RELATIONS%"=="NONE" (
set PARAM_OPTIONS_PRESENT=-define PARAM_OPTIONS_PRESENT
Expand All @@ -121,7 +123,7 @@ rem Configure standard command line options and the CodeGen environment

rem set SHOW_CODEGEN_COMMANDS=-e

set NOREPLACEOPTS=%SHOW_CODEGEN_COMMANDS% -lf -u %SolutionDir%UserDefinedTokens.tkn %NO_CUSTOM_PLURALIZATION% %ENABLE_GET_ALL% %ENABLE_GET_ONE% %ENABLE_OVERLAYS% %DO_NOT_SET_FILE_LOGICALS% %ENABLE_ALTERNATE_FIELD_NAMES% %ENABLE_AUTHENTICATION% %ENABLE_CUSTOM_AUTHENTICATION% %ENABLE_SIGNALR% %ENABLE_FIELD_SECURITY% %ENABLE_PROPERTY_ENDPOINTS% %ENABLE_CASE_SENSITIVE_URL% %ENABLE_CREATE_TEST_FILES% %ENABLE_CORS% %ENABLE_IIS_SUPPORT% %ENABLE_DELETE% %ENABLE_PUT% %ENABLE_POST% %ENABLE_PATCH% %ENABLE_ALTERNATE_KEYS% %ENABLE_PARTIAL_KEYS% %ENABLE_RELATIONS% %ENABLE_RELATIONS_VALIDATION% %ENABLE_SELECT% %ENABLE_FILTER% %ENABLE_ORDERBY% %ENABLE_COUNT% %ENABLE_TOP% %ENABLE_SKIP% %ENABLE_SPROC% %ENABLE_ADAPTER_ROUTING% %ENABLE_READ_ONLY_PROPERTIES% %ENABLE_NEWTONSOFT% %PARAM_OPTIONS_PRESENT% %EF_PROVIDER_MYSQL% -rps %RPSMFIL% %RPSTFIL%
set NOREPLACEOPTS=%SHOW_CODEGEN_COMMANDS% -lf -u %SolutionDir%UserDefinedTokens.tkn %NO_CUSTOM_PLURALIZATION% %ENABLE_GET_ALL% %ENABLE_GET_ONE% %ENABLE_OVERLAYS% %DO_NOT_SET_FILE_LOGICALS% %ENABLE_ALTERNATE_FIELD_NAMES% %ENABLE_AUTHENTICATION% %ENABLE_CUSTOM_AUTHENTICATION% %ENABLE_SIGNALR% %ENABLE_FIELD_SECURITY% %ENABLE_PROPERTY_ENDPOINTS% %ENABLE_CASE_SENSITIVE_URL% %ENABLE_CREATE_TEST_FILES% %ENABLE_CORS% %ENABLE_IIS_SUPPORT% %ENABLE_DELETE% %ENABLE_PUT% %ENABLE_POST% %ENABLE_PATCH% %ENABLE_ALTERNATE_KEYS% %ENABLE_PARTIAL_KEYS% %ENABLE_RELATIONS% %ENABLE_RELATIONS_VALIDATION% %ENABLE_SELECT% %ENABLE_FILTER% %ENABLE_ORDERBY% %ENABLE_COUNT% %ENABLE_TOP% %ENABLE_SKIP% %ENABLE_SPROC% %ENABLE_ADAPTER_ROUTING% %ENABLE_READ_ONLY_PROPERTIES% %ENABLE_NEWTONSOFT% %ENABLE_BLOCK_HTTP% %ENABLE_XMLDOC% %PARAM_OPTIONS_PRESENT% %EF_PROVIDER_MYSQL% -rps %RPSMFIL% %RPSTFIL%
set STDOPTS=%NOREPLACEOPTS% -r

rem ================================================================================================================================
Expand Down