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

encode uri before send #128

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
33 changes: 33 additions & 0 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will build a Java project with ant

name: Java CI with ant

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with ant
run: ANT_OPTS="-Dfile.encoding=UTF-8" ant
- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: dist-jar-zip-deb-exe-war
path: |
dist/*.jar
dist/*.zip
dist/*.deb
dist/*.exe
dist/*.war
6 changes: 4 additions & 2 deletions src/java/davmail/exchange/auth/ExchangeFormAuthenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.io.IOException;
import java.net.ConnectException;
import java.net.UnknownHostException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashSet;
Expand Down Expand Up @@ -219,8 +220,9 @@ public void authenticate() throws DavMailException {
if (isHttpAuthentication && !DavGatewayHttpClientFacade.hasNTLMorNegotiate(httpClient)) {
httpClient.getParams().setParameter(HttpClientParams.PREEMPTIVE_AUTHENTICATION, true);
}

exchangeUri = java.net.URI.create(method.getURI().getURI());
String uri = method.getURI().getURI();
String encodedUri = URLEncoder.encode(uri, StandardCharsets.UTF_8.toString());
exchangeUri = java.net.URI.create(encodedUri);
method.releaseConnection();

} catch (DavMailAuthenticationException exc) {
Expand Down