Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
383e4c62
Commit
383e4c62
authored
11 years ago
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
in case $_SERVER['HTTP_HOST']) is not set let's return localhost - better than nothing
parent
e013e7ad
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/request.php
+7
-7
7 additions, 7 deletions
lib/request.php
with
7 additions
and
7 deletions
lib/request.php
+
7
−
7
View file @
383e4c62
...
...
@@ -19,7 +19,7 @@ class OC_Request {
/**
* @brief Returns the server host
* @returns the server host
* @returns
string
the server host
*
* Returns the server host, even if the website uses one or more
* reverse proxies
...
...
@@ -40,7 +40,7 @@ class OC_Request {
}
}
else
{
$host
=
$_SERVER
[
'HTTP_HOST'
];
$host
=
isset
(
$_SERVER
[
'HTTP_HOST'
]
)
?
$_SERVER
[
'HTTP_HOST'
]
:
'localhost'
;
}
return
$host
;
}
...
...
@@ -48,7 +48,7 @@ class OC_Request {
/**
* @brief Returns the server protocol
* @returns the server protocol
* @returns
string
the server protocol
*
* Returns the server protocol. It respects reverse proxy servers and load balancers
*/
...
...
@@ -70,7 +70,7 @@ class OC_Request {
/**
* @brief Returns the request uri
* @returns the request uri
* @returns
string
the request uri
*
* Returns the request uri, even if the website uses one or more
* reverse proxies
...
...
@@ -85,7 +85,7 @@ class OC_Request {
/**
* @brief Returns the script name
* @returns the script name
* @returns
string
the script name
*
* Returns the script name, even if the website uses one or more
* reverse proxies
...
...
@@ -139,7 +139,7 @@ class OC_Request {
/**
* @brief Check if this is a no-cache request
* @returns true for no-cache
* @returns
boolean
true for no-cache
*/
static
public
function
isNoCache
()
{
if
(
!
isset
(
$_SERVER
[
'HTTP_CACHE_CONTROL'
]))
{
...
...
@@ -150,7 +150,7 @@ class OC_Request {
/**
* @brief Check if the requestor understands gzip
* @returns true for gzip encoding supported
* @returns
boolean
true for gzip encoding supported
*/
static
public
function
acceptGZip
()
{
if
(
!
isset
(
$_SERVER
[
'HTTP_ACCEPT_ENCODING'
]))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment