GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Create an error response body outside render_error (issue #144) by jimvm · Pull Request #232 · webmachine/webmachine-ruby

Conversation

@jimvm

@jimvm jimvm commented Oct 11, 2015

Copy link
Copy Markdown
Contributor

In l7 the resource and encodings_provided? is available so encode_body can be used. In this case the standard error response would have to be created outside of render_error though.

This works for gzip but not for deflate...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jimvm
Create an error response body outside render_error. Related to issue w…
a2019b6
…ebmachine#144.
@seancribbs

seancribbs commented Oct 11, 2015

Copy link
Copy Markdown
Member

I think the better solution would be to have render_error properly set the headers. If that means clearing the selected encoding, that would be preferable to reporting the content-length incorrectly.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jimvm

jimvm commented Oct 11, 2015

Copy link
Copy Markdown
Contributor Author

I guess I did not understand that correctly.

So the Content-Encoding header should be cleared because the Content-Length header can't be changed there. Even if encodings_provided is set, in case of a 404 Content-Encoding should be clear.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jimvm added 2 commits October 11, 2015 22:34
@jimvm
Don't encode the response body in l7.
15de537
@jimvm
Delete Content-Encoding header in render_error.
8eb13fd
It is not possible to correctly encode the response in render_error. So it is
better to delete the Content-Encoding header here.
@seancribbs

seancribbs commented Oct 12, 2015

Copy link
Copy Markdown
Member

@jimvm I was merely suggesting the most expedient solution, not a hard-and-fast one. Basically, regardless of what the response returns, the content-length needs to take into account the content-encoding, or we're in a lot of trouble.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@jimvm @seancribbs
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.