-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from awslabs/servlet-improvements
- Loading branch information
Showing
35 changed files
with
719 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...ner-core/src/main/java/com/amazonaws/serverless/proxy/internal/model/ContainerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.amazonaws.serverless.proxy.internal.model; | ||
|
||
|
||
/** | ||
* Configuration paramters used by the <code>RequestReader</code> and <code>ResponseWriter</code> objects. | ||
*/ | ||
public class ContainerConfig { | ||
|
||
public static ContainerConfig defaultConfig() { | ||
ContainerConfig configuration = new ContainerConfig(); | ||
configuration.setStripBasePath(false); | ||
|
||
return configuration; | ||
} | ||
|
||
//------------------------------------------------------------- | ||
// Variables - Private | ||
//------------------------------------------------------------- | ||
|
||
private String serviceBasePath; | ||
private boolean stripBasePath; | ||
|
||
|
||
//------------------------------------------------------------- | ||
// Methods - Getter/Setter | ||
//------------------------------------------------------------- | ||
|
||
public String getServiceBasePath() { | ||
return serviceBasePath; | ||
} | ||
|
||
|
||
public void setServiceBasePath(String serviceBasePath) { | ||
// clean up base path before setting it, we want a "/" at the beginning but not at the end. | ||
String finalBasePath = serviceBasePath; | ||
if (!finalBasePath.startsWith("/")) { | ||
finalBasePath = "/" + serviceBasePath; | ||
} | ||
if (finalBasePath.endsWith("/")) { | ||
finalBasePath = finalBasePath.substring(0, finalBasePath.length() - 1); | ||
} | ||
this.serviceBasePath = finalBasePath; | ||
} | ||
|
||
|
||
public boolean isStripBasePath() { | ||
return stripBasePath; | ||
} | ||
|
||
|
||
public void setStripBasePath(boolean stripBasePath) { | ||
this.stripBasePath = stripBasePath; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.