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

Fix content types of UserController#loginUser and UserController#logoutUser #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io.swagger.petstore.utils.Util;
import org.apache.commons.lang.math.RandomUtils;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.Date;

Expand Down Expand Up @@ -103,17 +104,16 @@ public ResponseContext createUsersWithListInput(final RequestContext request, fi
public ResponseContext loginUser(final RequestContext request, final String username, final String password) {
Date date = new Date(System.currentTimeMillis() + 3600000);
return new ResponseContext()
.contentType(Util.getMediaType(request))
.contentType(MediaType.TEXT_PLAIN)
.header("X-Rate-Limit", String.valueOf(5000))
.header("X-Expires-After", date.toString())
.entity("Logged in user session: " + RandomUtils.nextLong());
}

public ResponseContext logoutUser(final RequestContext request) {
return new ResponseContext()
.contentType(Util.getMediaType(request))
.contentType(MediaType.TEXT_PLAIN)
.entity("User logged out");

}

public ResponseContext deleteUser(final RequestContext request, final String username) {
Expand Down