Skip to content

Commit a751536

Browse files
authored
Update Status Code (#1914)
1 parent 1fa0b3f commit a751536

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

appengine-java8/firebase-tictactoe/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,14 @@ mvn appengine:run
4646
export GOOGLE_CLOUD_SDK_HOME=/path/to/google-cloud-sdk
4747
```
4848

49+
* If you see the error `Unauthorized request.`:
50+
* Make sure you've set the environment variable [`GOOGLE_APPLICATION_CREDENTIALS`](https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application) with
51+
your service account key.
52+
4953
## Contributing changes
5054

5155
See [CONTRIBUTING.md](../../CONTRIBUTING.md).
5256

5357
## Licensing
5458

5559
See [LICENSE](../../LICENSE).
56-

appengine-java8/firebase-tictactoe/src/main/java/com/example/appengine/firetactoe/MoveServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr
4242

4343
int cell = new Integer(request.getParameter("cell"));
4444
if (!game.makeMove(cell, currentUserId)) {
45-
response.sendError(HttpServletResponse.SC_FORBIDDEN);
45+
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
4646
} else {
4747
ofy.save().entity(game).now();
4848
}

appengine-java8/firebase-tictactoe/src/test/java/com/example/appengine/firetactoe/MoveServletTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public LowLevelHttpResponse execute() throws IOException {
150150
.buildRequest(eq("PATCH"), Matchers.matches(FIREBASE_DB_URL + "/channels/[\\w-]+.json$"));
151151
}
152152

153-
@Ignore // TODO: this wasn't running, and I've turned it off.
153+
@Test
154154
public void doPost_notMyTurn_move() throws Exception {
155155
// Insert a game
156156
Objectify ofy = ObjectifyService.ofy();

0 commit comments

Comments
 (0)