Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly encode password in ServerSettingsModel #359

Merged
merged 3 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci+cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
event_file:
name: "Event File"
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Upload
uses: actions/upload-artifact@v4
Expand All @@ -25,11 +25,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-22.04, windows-latest]
framework: [net462, net8.0]
exclude:
# dotnet on Linux cannot build net461 without additional, unnecessary, work
- os: ubuntu-latest
- os: ubuntu-22.04
framework: net462
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.framework }}
Expand All @@ -55,7 +55,7 @@ jobs:

- name: Install python2 for test execution
run: sudo apt-get install python2
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-22.04'

- name: Test Chorus
run: dotnet test src/Chorus.Tests/Chorus.Tests.csproj -f ${{ matrix.framework }} --no-build -c Release --filter TestCategory!=SkipOnBuildServer -- NUnit.TestOutputXml=TestResults
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:

publish-nuget:
name: "Publish NuGet package"
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: build-installers
if: github.event_name == 'push'
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
test-results:
name: Test Results
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.event.workflow_run.conclusion != 'skipped'

permissions:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed

- Prevent S&R to Internet without full URL
- [SIL.Chorus.LibChorus] Correctly handle & and other special characters in passwords

## [5.1.0] - 2023-03-07

Expand Down
3 changes: 2 additions & 1 deletion src/LibChorus/Model/ServerSettingsModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using Chorus.Properties;
using Chorus.Utilities;
using Chorus.VcsDrivers;
Expand Down Expand Up @@ -335,7 +336,7 @@ private WebResponse LogIn()
var privateQuery = IsPrivateServer ? "?private=true" : string.Empty;
var request = WebRequest.Create($"https://admin{LanguageForgeServer}/api/user/{Username}/projects{privateQuery}");
request.Method = "POST";
var passwordBytes = Encoding.UTF8.GetBytes($"password={Password}");
var passwordBytes = Encoding.UTF8.GetBytes($"password={HttpUtility.UrlEncode(Password)}");
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = passwordBytes.Length;
var passwordStream = request.GetRequestStream();
Expand Down
Loading