mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-10 23:45:50 +01:00
Check the null value of UserAgent
This commit is contained in:
@@ -146,9 +146,11 @@ case class Context(settings: SystemSettingsService.SystemSettings, loginAccount:
|
|||||||
val baseUrl = settings.baseUrl(request)
|
val baseUrl = settings.baseUrl(request)
|
||||||
val host = new java.net.URL(baseUrl).getHost
|
val host = new java.net.URL(baseUrl).getHost
|
||||||
val platform = request.getHeader("User-Agent") match {
|
val platform = request.getHeader("User-Agent") match {
|
||||||
|
case null => null
|
||||||
case agent if agent.contains("Mac") => "mac"
|
case agent if agent.contains("Mac") => "mac"
|
||||||
case agent if agent.contains("Linux") => "linux"
|
case agent if agent.contains("Linux") => "linux"
|
||||||
case agent if agent.contains("Win") => "windows"
|
case agent if agent.contains("Win") => "windows"
|
||||||
|
case _ => null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@id.map { id =>
|
@id.map { id =>
|
||||||
@if(context.platform != "linux"){
|
@if(context.platform != "linux" || context.platform != null){
|
||||||
<div style="margin-top: 10px;">
|
<div style="margin-top: 10px;">
|
||||||
<a href="@repository.httpOpenRepoUrl(context.platform)" id="repository-clone-url" class="btn btn-small" style="width: 147px;"><i class="icon-download-alt"></i>Clone in Desktop</a>
|
<a href="@repository.httpOpenRepoUrl(context.platform)" id="repository-clone-url" class="btn btn-small" style="width: 147px;"><i class="icon-download-alt"></i>Clone in Desktop</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user