Skip to content

Commit

Permalink
Align embedded and XML defaults for HttpConfiguration (#12555)
Browse files Browse the repository at this point in the history
Fix #11947 by aligning embedded and XML HttpConfiguration defaults
  • Loading branch information
gregw authored Nov 29, 2024
1 parent d1fc707 commit 8ca1c05
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion jetty-core/jetty-server/src/main/config/etc/jetty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<Set name="uriCompliance"><Call class="org.eclipse.jetty.http.UriCompliance" name="from"><Arg><Property name="jetty.httpConfig.uriCompliance" default="DEFAULT"/></Arg></Call></Set>
<Set name="requestCookieCompliance"><Call class="org.eclipse.jetty.http.CookieCompliance" name="from"><Arg><Property name="jetty.httpConfig.requestCookieCompliance" default="RFC6265"/></Arg></Call></Set>
<Set name="responseCookieCompliance"><Call class="org.eclipse.jetty.http.CookieCompliance" name="from"><Arg><Property name="jetty.httpConfig.responseCookieCompliance" default="RFC6265"/></Arg></Call></Set>
<Set name="relativeRedirectAllowed"><Property name="jetty.httpConfig.relativeRedirectAllowed" default="false"/></Set>
<Set name="relativeRedirectAllowed" property="jetty.httpConfig.relativeRedirectAllowed"/>
<Set name="generateRedirectBody" property="jetty.httpConfig.generateRedirectBody"/>
<Set name="useInputDirectByteBuffers" property="jetty.httpConfig.useInputDirectByteBuffers"/>
<Set name="useOutputDirectByteBuffers" property="jetty.httpConfig.useOutputDirectByteBuffers"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public class DefaultHandler extends Handler.Abstract
private final long _faviconModifiedMs = (System.currentTimeMillis() / 1000) * 1000L;
private final HttpField _faviconModified = new PreEncodedHttpField(HttpHeader.LAST_MODIFIED, DateGenerator.formatDate(_faviconModifiedMs));
private ByteBuffer _favicon;
private boolean _serveFavIcon = true;
private boolean _showContexts = true;
private boolean _serveFavIcon;
private boolean _showContexts;

public DefaultHandler()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// ========================================================================
//

package org.eclipse.jetty.ee10.tests.distribution;
package org.eclipse.jetty.tests.distribution;

import java.io.FileWriter;
import java.nio.file.Files;
Expand All @@ -21,12 +21,11 @@

import org.eclipse.jetty.client.ContentResponse;
import org.eclipse.jetty.client.FormRequestContent;
import org.eclipse.jetty.ee10.tests.distribution.siwe.EthereumCredentials;
import org.eclipse.jetty.ee10.tests.distribution.siwe.SignInWithEthereumGenerator;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.security.siwe.EthereumAuthenticator;
import org.eclipse.jetty.tests.distribution.AbstractJettyHomeTest;
import org.eclipse.jetty.tests.distribution.siwe.EthereumCredentials;
import org.eclipse.jetty.tests.distribution.siwe.SignInWithEthereumGenerator;
import org.eclipse.jetty.tests.testers.JettyHomeTester;
import org.eclipse.jetty.tests.testers.Tester;
import org.eclipse.jetty.util.Fields;
Expand Down Expand Up @@ -100,8 +99,7 @@ public void testSiwe() throws Exception
client.setFollowRedirects(false);
response = client.GET(uri + "/admin");
assertThat(response.getStatus(), is(HttpStatus.FOUND_302));
assertThat(response.getHeaders().get(HttpHeader.LOCATION),
containsString(uri + "/login.html"));
assertThat(response.getHeaders().get(HttpHeader.LOCATION), containsString("/login.html"));

// Fetch a nonce from the server.
response = client.GET(uri + "/auth/nonce");
Expand All @@ -112,8 +110,7 @@ public void testSiwe() throws Exception
FormRequestContent authRequestContent = getAuthRequestContent(port, nonce);
response = client.POST(uri + "/auth/login").body(authRequestContent).send();
assertThat(response.getStatus(), is(HttpStatus.SEE_OTHER_303));
assertThat(response.getHeaders().get(HttpHeader.LOCATION),
containsString(uri + "/admin"));
assertThat(response.getHeaders().get(HttpHeader.LOCATION), containsString("/admin"));

// We can access /admin as user has the admin role.
response = client.GET(uri + "/admin");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// ========================================================================
//

package org.eclipse.jetty.ee10.tests.distribution.siwe;
package org.eclipse.jetty.tests.distribution.siwe;

import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// ========================================================================
//

package org.eclipse.jetty.ee10.tests.distribution.siwe;
package org.eclipse.jetty.tests.distribution.siwe;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
Expand Down

0 comments on commit 8ca1c05

Please sign in to comment.