mirror of
https://github.com/desktop/desktop
synced 2024-11-05 20:49:32 +00:00
GHE uses dotcom stealth host
For now at least Co-Authored-By: Sergio Padrino <1083228+sergiou87@users.noreply.github.com>
This commit is contained in:
parent
33d197f822
commit
9035052e68
1 changed files with 4 additions and 5 deletions
|
@ -1,5 +1,3 @@
|
|||
import * as URL from 'url'
|
||||
|
||||
import { IAPIEmail, getDotComAPIEndpoint } from './api'
|
||||
import { Account } from '../models/account'
|
||||
|
||||
|
@ -54,9 +52,10 @@ function isEmailPublic(email: IAPIEmail): boolean {
|
|||
* endpoint host.
|
||||
*/
|
||||
function getStealthEmailHostForEndpoint(endpoint: string) {
|
||||
return getDotComAPIEndpoint() !== endpoint
|
||||
? `users.noreply.${URL.parse(endpoint).hostname}`
|
||||
: 'users.noreply.github.com'
|
||||
const { hostname } = new URL(endpoint)
|
||||
return endpoint === getDotComAPIEndpoint() || endpoint.endsWith(`.ghe.com`)
|
||||
? 'users.noreply.github.com'
|
||||
: `users.noreply.${hostname}`
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue