Skip to content

Commit 1094f86

Browse files
authored
Merge pull request #306 from Mardoxx/patch-1
Only send Authorization header if token is present
2 parents 44fb410 + cd627a3 commit 1094f86

File tree

1 file changed

+3
-2
lines changed
  • aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Host/wwwroot/swagger/ui

1 file changed

+3
-2
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Host/wwwroot/swagger/ui/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@
7979
configObject.presets = [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset];
8080
configObject.layout = "StandaloneLayout";
8181
configObject.requestInterceptor = function (request) {
82-
request.headers.Authorization = "Bearer " + abp.auth.getToken();
82+
var token = abp.auth.getToken();
83+
request.headers.Authorization = token ? "Bearer " + token : null;
8384
return request;
8485
};
8586
if (!configObject.hasOwnProperty("oauth2RedirectUrl")) {
@@ -129,4 +130,4 @@
129130
</script>
130131
</body>
131132

132-
</html>
133+
</html>

0 commit comments

Comments
 (0)