Skip to content

cy.visit does not send headers / change HTTP method when baseUrl contains :80 #5367

@Richard-Walton

Description

@Richard-Walton

Current behavior:

cy.visit({ url, method, headers }) does not appear to honour the method, or headers

Desired behavior:

cy.visit({ url, method, headers }) should send the specified method and headers.

Steps to reproduce: (app code and test code)

cy.visit({ 
  url: '/ui', 
  method: 'POST',
  headers: {
    'mock-user': JSON.stringify(mockUser)
  }
});

I include an annotated Cypress debug log:

debug-log

Changing the method to GET still results in the headers not being sent

Versions

I tested Cypress 3.4.1 and 3.2.0.
Ubuntu LTS
Chrome 77

UPDATE: Cause tracked down to: #5367 (comment)

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions