Fix#9001
The GZIP ProxyReponseWriter doesn't currently respond correctly
to requests about its Written status - leading to #9001.
This PR properly reimplements these methods.
Fix#8718
This PR shadows passwords in session config correctly by detecting
the VirtualProvider, unmarshalling the original config and then
shadowing config within that.
Backport #8901
In investigating #7947 it has become clear that the storage component of go-git repositories needs closing.
This PR adds this Close function and adds the Close functions as necessary.
In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files.
Fixes#7947
Update all Github migration tests to use a new repo created just for
these tests that won't accidentially be modified by regular users
interacting with issues.
Fixes#8895
Earlier today #716 was reopened which updated the modification time for
an old milestone (1.6.0) that we use in testing with the assumption that
it is old and won't change. This breaks all builds now, so remove this
test since we have others that test the same code and this milestone
will likely be updated again as that issue changes etc...
* Fix commit expand button to not go to commit link
* Fix message rendering to have correct HTML in result
* Fix check for empty commit message
* Code optimization
Avoid out of bounds error by using strings.HasPrefix to check for
starting SSH2 text rather than assuming user input has at least 31
characters.
Add tests for bad input as well.
Fixes#8800
* if a filename in a repository contains " or \ the owner can't merge pull request with this files
because "git diff-tree" adds double quotes to that filepath
example: filepath is ab"cd but "git diff-tree" returns "ab\"cd"
now, when the owner click "Merge Pull Request" button the server returns 500
this commit fix it
Signed-off-by: Ilya Pavlov <ilux@cpan.org>
* add -z option to getDiffTree
escape spec symbols for sparse-checkout
Signed-off-by: Ilya Pavlov <ilux@cpan.org>
* go fmt
Signed-off-by: Ilya Pavlov <ilux@cpan.org>
* typo
Signed-off-by: Ilya Pavlov <ilux@cpan.org>
* escape '\'
escape all spaces and '!'
* use regexp.ReplaceAllString()
Signed-off-by: Ilya Pavlov <ilux@cpan.org>
* strings.ReplaceAll was added in go 1.12
Signed-off-by: Ilya Pavlov <ilux@cpan.org>
* add '\' to regexp.MustCompile
Signed-off-by: Ilya Pavlov <ilux@cpan.org>
Backport #8653
When doing GET /api/v1/users/{user} as an unauthenticated user,
gitea throws a 500 because it's trying to dereference elements
from the context user. It wants to do this to see whether to
show the primary email and will do that if the logged in user
is admin or the user in question. However, if ctx.User is nil there is a panic
Partial backport without changes to locale files.
Fix#8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template
Fixes /explore and organisation redirection
* Expose db.SetMaxOpenConns and allow other dbs to set their connection params
* Add note about port exhaustion
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
This PR ensures that once opened the diff stats detail box can be scrolled independently of the diff on the compare page.
Fixes#5532
Details:
* make diff-detail-box the main container
* move file diff at the same level as diff-stats
* make diff-view options sticy again
* make diff-stats scroll if to mouch
* rm useless css info
* less: mv diff-stats to own class
* use new css class
* cleanup less file
* diff-counter: margin-right: 15px;
* make CI work
* make numbers colorful
* add sign (-/+) to numbers
This header is missing since switching http client from GiteaServer (`code.gitea.io/gitea/modules/httplib`) to Go-http-client/1.1 (`net.http`). The header [was added by default](https://github.com/go-gitea/gitea/blob/release/v1.8/modules/httplib/httplib.go#L301) by the former, but this is no longer true with `net.http`, so it needs to be done explicitly.
Closes: #7700
* Fix#8582 by handling empty repos
Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Fix tests
Signed-off-by: Jonas Franz <info@jonasfranz.software>