-
Notifications
You must be signed in to change notification settings - Fork 6
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 #23 from CaritasDeutschland/feature-file-upload-re…
…striction feat: optimize quota reached header
- Loading branch information
Showing
3 changed files
with
33 additions
and
4 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
28 changes: 28 additions & 0 deletions
28
src/main/java/de/caritas/cob/uploadservice/api/exception/cutomheader/CustomHttpHeader.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,28 @@ | ||
package de.caritas.cob.uploadservice.api.exception.cutomheader; | ||
|
||
import lombok.AllArgsConstructor; | ||
import org.springframework.http.HttpHeaders; | ||
|
||
/** | ||
* Constants to build custom http headers. | ||
*/ | ||
@AllArgsConstructor | ||
public enum CustomHttpHeader { | ||
|
||
QUOTA_REACHED("X-Reason", "QUOTA_REACHED"); | ||
|
||
private final String headerName; | ||
private final String headerValue; | ||
|
||
/** | ||
* Builds the {@link HttpHeaders} for the custom values. | ||
* | ||
* @return the {@link HttpHeaders} instance | ||
*/ | ||
public HttpHeaders buildHeader() { | ||
HttpHeaders headers = new HttpHeaders(); | ||
headers.add(headerName, headerValue); | ||
return headers; | ||
} | ||
|
||
} |
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