Skip to content

fix: request cannot have request body error #1099

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

Merged
merged 4 commits into from
Jul 4, 2025
Merged

fix: request cannot have request body error #1099

merged 4 commits into from
Jul 4, 2025

Conversation

ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Jul 2, 2025

What does this PR do?

  • fixes request cannot have body in ws connection
  • fixes warnings for escaping keywords in argument list
    Screenshot 2025-07-03 at 10 22 13 AM
  • fixes warnings for not using error
    Screenshot 2025-07-03 at 10 24 56 AM

Test Plan

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

yes

@ChiragAgg5k ChiragAgg5k requested review from Copilot and abnegate July 3, 2025 05:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes unintended request bodies for WebSocket connections and addresses Swift compiler warnings by adjusting keyword escaping and unused variables.

  • Drop Content-Type, Content-Length, and empty body for WebSocket HTTP upgrade.
  • Change if let error = error to if error != nil to resolve unused binding.
  • Remove escapeSwiftKeyword on model properties (potentially breaking when names collide with Swift keywords).

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
templates/swift/Sources/WebSockets/HTTPHandler.swift.twig Removed headers and body write to avoid sending a request body on WS
templates/swift/Sources/OAuth/WebAuthComponent.swift.twig Simplified error check and corrected first(where:) usage for windows
templates/swift/Sources/Models/Model.swift.twig Dropped keyword escaping in model generator (may cause identifier issues)
Comments suppressed due to low confidence (1)

templates/swift/Sources/Models/Model.swift.twig:85

  • Removing escapeSwiftKeyword may lead to invalid Swift identifiers when a property name matches a reserved keyword. Reintroduce keyword escaping to avoid compile errors.
            {{ property.name | removeDollarSign }}: {% if property.sub_schema -%}

@abnegate abnegate merged commit 3704184 into master Jul 4, 2025
37 checks passed
@abnegate abnegate deleted the pla-3167 branch July 4, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants