Skip to content

Commit f883545

Browse files
update
1 parent af11acb commit f883545

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

backend-challenge/readme.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ you make.
2828

2929
Functional requirements:
3030

31-
- [ ] Clients should be able to uniquely identify themselves with a phone number
32-
(without authentication)
33-
- [ ] Clients should be able to send messages to other clients, identified by their
34-
phone number
35-
- [ ] Clients should be able to list their chats
31+
- [ ] Clients should be able to uniquely identify themselves
32+
- [ ] Clients should be able to send messages to other clients
33+
- [ ] Clients should be able to list all their chats
3634
- [ ] Clients should be able to list all messages in a chat
3735

3836
## Bonus

client-challenge/server/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.22.5
44

55
require (
66
github.com/go-chi/chi/v5 v5.2.0
7+
github.com/go-chi/cors v1.2.1
78
github.com/go-chi/render v1.0.3
89
github.com/google/uuid v1.6.0
910
github.com/r3labs/sse/v2 v2.10.0

client-challenge/server/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
44
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
55
github.com/go-chi/chi/v5 v5.2.0 h1:Aj1EtB0qR2Rdo2dG4O94RIU35w2lvQSj6BRA4+qwFL0=
66
github.com/go-chi/chi/v5 v5.2.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
7+
github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
8+
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
79
github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4=
810
github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0=
911
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=

client-challenge/server/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ func main() {
4949
r.Use(cors.Handler(cors.Options{
5050
AllowOriginFunc: func(r *http.Request, origin string) bool { return true },
5151
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
52-
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token"},
52+
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token", "Idempotency-Key"},
53+
ExposedHeaders: []string{"Link"},
5354
AllowCredentials: true,
54-
MaxAge: 300,
55+
MaxAge: 300, // Maximum value not ignored by any of major browsers
5556
}))
5657

5758
r.Handle("/events", http.HandlerFunc(events.ServeHTTP))

0 commit comments

Comments
 (0)