Add CORS headers and update UI for enhanced user profile handling.
- Added CORS support in server responses for cross-origin requests (`Access-Control-Allow-Origin`, etc.). - Improved header panel behavior with a sticky position and refined CSS styling. - Integrated profile data fetching (Kind 0 metadata) for user personalization. - Enhanced login functionality to support dynamic profile display based on fetched metadata. - Updated `index.html` to include Tailwind CSS for better design consistency.
This commit is contained in:
@@ -34,6 +34,17 @@ type Server struct {
|
||||
}
|
||||
|
||||
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// Set CORS headers for all responses
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, OPTIONS")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization")
|
||||
|
||||
// Handle preflight OPTIONS requests
|
||||
if r.Method == "OPTIONS" {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
return
|
||||
}
|
||||
|
||||
// log.T.C(
|
||||
// func() string {
|
||||
// return fmt.Sprintf("path %v header %v", r.URL, r.Header)
|
||||
|
||||
Reference in New Issue
Block a user