mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-21 11:19:38 +03:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e2bbcec62 | ||
|
|
fdd339f525 | ||
|
|
16d8a667b1 | ||
|
|
8cf7d6a83d | ||
|
|
58a5008718 | ||
|
|
7a4425473b |
@@ -25,7 +25,12 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
// Set root URL
|
||||
URL::forceRootUrl(config('app.url'));
|
||||
$appUrl = config('app.url');
|
||||
if ($appUrl) {
|
||||
$isHttps = (strpos($appUrl, 'https://') === 0);
|
||||
URL::forceRootUrl($appUrl);
|
||||
URL::forceScheme($isHttps ? 'https' : 'http');
|
||||
}
|
||||
|
||||
// Custom validation methods
|
||||
Validator::extend('image_extension', function ($attribute, $value, $parameters, $validator) {
|
||||
|
||||
2
public/dist/app.js
vendored
2
public/dist/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -67,7 +67,7 @@ async function dataRequest(method, url, data = null) {
|
||||
body: data,
|
||||
};
|
||||
|
||||
if (typeof data === 'object') {
|
||||
if (typeof data === 'object' && !(data instanceof FormData)) {
|
||||
options.headers = {'Content-Type': 'application/json'};
|
||||
options.body = JSON.stringify(data);
|
||||
}
|
||||
|
||||
@@ -22,4 +22,12 @@ class UrlTest extends TestCase
|
||||
putenv('APP_URL=');
|
||||
}
|
||||
|
||||
public function test_url_helper_sets_correct_scheme_even_when_request_scheme_is_different()
|
||||
{
|
||||
putenv('APP_URL=https://example.com/');
|
||||
$this->refreshApplication();
|
||||
$this->get('http://example.com/login')->assertSee('https://example.com/dist/styles.css');
|
||||
putenv('APP_URL=');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user